title: How to draw a system architecture with databases and shadows?

text: My goal is to draw a complex system architecture. Some approaches to do it are here How to draw a layered architecture using Latex? This approach http://tex.stackexchange.com/a/102669/44348 seems to be very interesting, so one can make following modifications in that example:   1. Add shadow options `\usetikzlibrary{shadows}`   2. Add a way to cut shadows from a node, please, see here remove drop shadow from one node   3. Make `nodes in empty cells=false`   4. Add `|[no shadows]|` to the cell that is going to be merged just to make a shape, anchor and name of this cell and prevent a mistake e.c.t. I've some problems with:   1. Adding the pictures, like database Display Database Instance Relationship with TikZ, for example in the cells `(stack-5-6) (stack-6-6)` with the name to make an arrow in future.   2. Creating an arbitrary block of nodes with the border and shadow, for example     * we don't have a border and shadow near the cell `(stack-3-4)`,     * we can't set a color of the matrix' body, because it'will be over the blocks with background.  A way of adding pictures is described here Nodes and matrix of nodes but I can't adopt it well. A way of creating blocks as backround layers is described here http://www.texample.net/tikz/examples/kalman-filter/ but I can't have right borders and shadows. There is a problem to use `fit` option of `background` to get a good solution. The MWE is                   \documentclass[border=3mm]{standalone}         \usepackage{tikz}         \usetikzlibrary{backgrounds,shadows,positioning,fit,matrix,shapes.geometric} % add shadows #1              % a way to cut shadows in a cell #2         %http://tex.stackexchange.com/questions/129318/remove-drop-shadow-from-one-node         \makeatletter         \tikzset{no shadows/.code=\let\tikz@preactions\pgfutil@empty}         \makeatother                   \tikzstyle{background}=[rectangle,          fill=red!10,         inner sep=0.2cm]         %rounded corners=5mm] % it would be great to use rounded corners...              \tikzstyle{backgroundN}=[rectangle, % to cut the background's node         fill=white,         inner sep=0.3cm]         %rounded corners=5mm] % it would be great to use rounded corners...              \tikzstyle{backgroundNN}=[rectangle, % to create the background's node         fill=red!10,         inner sep=0.2cm]         %rounded corners=5mm] % it would be great to use rounded corners...                   \definecolor{mybluei}{RGB}{124,156,205}         \definecolor{myblueii}{RGB}{73,121,193}         \definecolor{mygreen}{RGB}{202,217,126}         \definecolor{mypink}{RGB}{233,198,235}              \newcommand\widernode[5][widebox]{         \node[             #1,             fit={(#2) (#3)},             label=center:{\sffamily\bfseries\color{black}#4}] (#5) {};         }              \begin{document}              \begin{tikzpicture}[node distance=2pt,outer sep=0pt, % just do nothing after modification         boxstyle/.style={         draw=white,         fill=#1,         rounded corners, drop shadow, %to get a shadow in below a node         font={\sffamily\bfseries\color{white}},         align=center,         minimum height=30pt         },         box/.style={         boxstyle=#1,         text width=2.5cm},         box/.default=mybluei,         title/.style={font={\sffamily\bfseries\color{black}}},         widebox/.style={draw=white,inner sep=0pt, rounded corners,fill=#1,drop shadow},         widebox/.default=mybluei,         mylabel/.style={font={\sffamily\bfseries\color{black}}},         ]                   \matrix (stack) [draw=black,%  boxstyle=mybluei!40,%will overpaint blocks with background         column sep=10pt, row sep=10pt, inner sep=4mm,%             matrix of nodes,                 nodes={box, outer sep=0pt, anchor=center, inner sep=3pt},%                   nodes in empty cells=false,% #3             row 1/.style={nodes={fill=none,draw=none,minimum height=3mm}},         ]         {         |[no shadows]|&  & & &|[no shadows]|&|[no shadows]| \\ % #5         RCP main & Authoring & Browsing & Publishing & Search&|[no shadows]|\\         Rich Text &|[no shadows]| &|[no shadows]| &{XML\\ Export/Import} & MSP Export&|[no shadows]|\\         Common & |[no shadows]|&|[no shadows]| & |[no shadows]|&|[no shadows]| &\node[rotate=10] {Hello};\\         |[box=mypink]| Jtidy & |[no shadows]|&|[no shadows]| &|[box=mygreen]| GEF &|box=mygreen]| ICU4J & \\         |[no shadows]|& && &|[no shadows]|&\\};                   \widernode[]{stack-1-1}{stack-1-5}{EPF Composer}{EPF} %#5                        \widernode{stack-3-2}{stack-3-3}{Library Management}{LMg}         \widernode{stack-4-2}{stack-4-3}{UMA}{UMA}         \widernode{stack-4-4}{stack-4-5}{Export/Import}{ExImp}         \widernode[widebox=mygreen]{stack-5-2}{stack-5-3}{EMF}{EMF}         \widernode[widebox=mygreen]{stack-6-1}{stack-6-5}{RCP Runtime}{RCPrun}                        \widernode{stack-2-6}{stack-3-6}{\begin{tikzpicture}         \node[align=center] (a) {Normal text\\works};         \end{tikzpicture}}{NTWorks}                        \node [fit={(stack.south west)(stack.south east)},boxstyle=myblueii,draw=black,inner sep=0pt,below=3pt of stack.south,anchor=north,label={[mylabel]center:Java Runtime}] (JavaR) {};                        % smth to create an arbitrary block with a border and shadow             \begin{pgfonlayer}{background}                 \node [background,                     fit=(stack-2-1) (stack-4-1)(stack-4-5),draw, drop shadow,                 ] {};                 \node [backgroundN,                     fit=(stack-3-5) ] {};                 \node [backgroundNN,draw, drop shadow,                     fit=(stack-3-5) ] {};                                                    \end{pgfonlayer}              \end{tikzpicture}              \end{document}      The output AS-IS: ![AS_IS](http://i.stack.imgur.com/BRh7R.jpg) The output TO-BE: ![enter image description here](http://i.stack.imgur.com/BFs4c.jpg)


title: How to update TexWorks on Debian 6 Synaptic/apt-get

text: Synaptic has only version 2.3 listed. I want the latest version 4.0. I want to avoid manual compilation, dependency hell, all that. How do I update to version 4.0? Thanks.               peter@debian-peter:~$ sudo apt-get install texworks     [sudo] password for peter:      Reading package lists... Done     Building dependency tree            Reading state information... Done     texworks is already the newest version.     The following packages were automatically installed and are no longer required:       liburiparser1 libcurl3 libssh2-1     Use 'apt-get autoremove' to remove them.     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     N: Ignoring file 'apt-build' in directory '/etc/apt/sources.list.d/' as it has no filename extension     peter@debian-peter:~$ apt-build install texworks     Package texworks already in repository.     -----> Updating package lists <-----     N: Ignoring file 'apt-build' in directory '/etc/apt/sources.list.d/' as it has no filename extension     E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)     E: Unable to lock directory /var/lib/apt/lists/     E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)     E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?     E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)     E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?     peter@debian-peter:~$ sudo apt-build install texworks     Package texworks already in repository.     -----> Updating package lists <-----     Ign cdrom://[Debian GNU/Linux 6.0.0 _Squeeze_ - Official i386 CD Binary-1 20110205-17:27] squeeze Release.gpg     Ign file: apt-build Release.gpg     Ign file:/var/cache/apt-build/repository/ apt-build/main Translation-en             Ign file:/var/cache/apt-build/repository/ apt-build/main Translation-en_AU          Get:1 file: apt-build Release [89 B]                                                Ign file: apt-build/main i386 Packages                                              Ign file: apt-build/main i386 Packages                                              Hit http://security.debian.org squeeze/updates Release.gpg                          Ign http://security.debian.org/ squeeze/updates/main Translation-en                 Ign http://security.debian.org/ squeeze/updates/main Translation-en_AU              Hit http://ftp.au.debian.org squeeze Release.gpg                                    Ign http://ftp.au.debian.org/debian/ squeeze/main Translation-en                    Ign http://ftp.au.debian.org/debian/ squeeze/main Translation-en_AU           Hit http://security.debian.org squeeze/updates Release                        Hit http://ftp.au.debian.org squeeze-updates Release.gpg                            Ign http://ftp.au.debian.org/debian/ squeeze-updates/main Translation-en            Ign http://ftp.au.debian.org/debian/ squeeze-updates/main Translation-en_AU     Hit http://ftp.au.debian.org squeeze Release                                        Hit http://ftp.au.debian.org squeeze-updates Release                                Hit http://security.debian.org squeeze/updates/main Sources                         Hit http://security.debian.org squeeze/updates/main i386 Packages                   Hit http://ftp.au.debian.org squeeze/main Sources                                   Hit http://ftp.au.debian.org squeeze/main i386 Packages                       Hit http://ftp.au.debian.org squeeze-updates/main Sources/DiffIndex     Hit http://ftp.au.debian.org squeeze-updates/main i386 Packages/DiffIndex     Hit http://ftp.au.debian.org squeeze-updates/main i386 Packages     Hit http://ftp.debian.org sid Release.gpg               Hit http://ftp.debian.org sid Release                   Hit http://ftp.debian.org sid/main Sources/DiffIndex     Ign cdrom://[Debian GNU/Linux 6.0.0 _Squeeze_ - Official i386 CD Binary-1 20110205-17:27]/ squeeze/main Translation-en     Ign cdrom://[Debian GNU/Linux 6.0.0 _Squeeze_ - Official i386 CD Binary-1 20110205-17:27]/ squeeze/main Translation-en_AU     Ign cdrom://[Debian GNU/Linux 6.0.0 _Squeeze_ - Official i386 CD Binary-1 20110205-17:27] squeeze Release     Ign cdrom://[Debian GNU/Linux 6.0.0 _Squeeze_ - Official i386 CD Binary-1 20110205-17:27] squeeze/main i386 Packages/DiffIndex     Reading package lists... Done     N: Ignoring file 'apt-build' in directory '/etc/apt/sources.list.d/' as it has no filename extension     Reading package lists... Done     Building dependency tree            Reading state information... Done     texworks is already the newest version.     The following packages were automatically installed and are no longer required:       liburiparser1 libcurl3 libssh2-1     Use 'apt-get autoremove' to remove them.     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     N: Ignoring file 'apt-build' in directory '/etc/apt/sources.list.d/' as it has no filename extension


title: How to show break in lines in tikz?

text: Im not sure what the term used for what I want so I will explain it. I want a double long drawn "S" to show that the line in my figure is actually longer than is shown- implying that there is a missing segment in between the two "S"s in the picture. If you look at the output of the diagram below it might make more sense. Looking at the dimensions in the picture, it is obvious that the lines are not drawn to scale, hence I need the lines to contain a break of the form I described above. EDIT: Here is a rough example of what I mean, showing the break. I guess the slanted line could also work but the "S" is ideal but should be uniformly thinner than shown in this picture. ![example](http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Y-axis_break.svg/175px- Y-axis_break.svg.png)               \documentclass[tikz]{standalone}     \begin{document}     \begin{tikzpicture}     \draw (4,0.2) -- (8,0.2);     \draw (4,1.8) -- (8,1.8);     \draw[semithick,to-to] (4,2.5) -- +(16,0) node[fill=white,font=\footnotesize] at +(7.75,0) {100 m};               \draw[semithick,to-to] (4,-1) -- +(8,0) node[fill=white,font=\footnotesize] at +(4.0,0) {10 m};     \end{tikzpicture}     \end{document}


title: How to replicate this chess-related list formatting?

text: I'm trying to create a chess-repeated document. I already understand how to use the skak package to put chess piece symbols in my documents. My current question is more pedestrian. I would like to replicate the list formatting in the picture at the end of this question (except with the page numbers replaced by more moves and personal notes). What is the best way to do this? The only possibility I'm aware of is using a bunch of nested enumerate commands, but this seems very messy and would require me to tinker with the starting value for each one. I'm hoping someone more experienced can point me to a cleaner solution. ![enter image description here](http://i.stack.imgur.com/t64Yu.png) (from _How to Beat the Sicilian Defence_ by Gawain Jones)


title: Two logos in opposite side on beamer

text: I am making a presentation in beamer. Because I am affiliated in two organisations, I want to have two logos, one on bottom left corner and the other one on the top right corner. How can I do that? Right now I am using               \documentclass[slidestop,compress,mathserif,12pt,xcolor=dvipsnames]{beamer}     \definecolor{LHCblue}{RGB}{4, 114, 255}     \usecolortheme[named=LHCblue]{structure}     \usepackage[bars]{beamerthemetree} % Beamer theme v 2.2     \usepackage{kerkis}     \usepackage{multimedia}     \usepackage{subfigure}     \mode<presentation>     \newcommand*\oldmacro{}%     \let\oldmacro\insertshorttitle%     \renewcommand*\insertshorttitle{%       \oldmacro\hfill%       \insertframenumber\,}%/\,\inserttotalframenumber     \setbeamertemplate{footline}[frame number]     %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     \setbeamercovered{higly dynamic}     \usetheme{Ilmenau} % Beamer theme v 3.0     \useoutertheme[subsection=true]{smoothbars}%Beamer Outer Theme-circles on top     \useinnertheme{circles} %rectangle bullet points instead of circle ones     \usepackage{beamerthemebars}     \setbeamercolor{navigation symbols dimmed}{fg=red!80!black}     \setbeamercolor{navigation symbols}{fg=red!80!black}     %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     \title{July 2012 H4 Test Beam}     \author[Stamatopoulos N. Athanasios\hspace{2.5cm}{athanasios.stamatopoulos@cern.ch}]    {Stamatopoulos N. Athanasios}     \institute{NTUA/CERN}     \logo{%         \includegraphics[width=1cm,height=1cm,keepaspectratio]{cern_logo_white.jpg}~%         \includegraphics[width=1cm,height=1cm,keepaspectratio]{ntua-logo.jpg}%     }     \usepackage{textpos}          \begin{document}          \begin{frame}     \titlepage     \end{frame}          \begin{frame}     Good Morning Vietnam!!!     \end{frame}          \end{document}       which gives ![presentation](http://i.imgur.com/KZyY6.jpg)


title: Monochrome in Tikz

text: > **Possible Duplicate:**   >  how to create PDF in grayscale mode or TikZ figure only? How to convert tikz figure in monochrome? Example:               \documentclass{article}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}        \draw[red] circle (1);     \end{tikzpicture}          \end{document}      But i need the below result: ![enter image description here](http://i.stack.imgur.com/RP0pr.png)


title: Best way to do referencing with LaTeX? - I use Zotero to manage citations

text: > **Possible Duplicate:**   >  bibtex vs. biber and biblatex vs. natbib **What's the best way to add references and a bibliography to a LaTeX document?** Note: I'm using Zotero as my citation manager, which has an export to bibtex feature.


title: Changing font in Farsi/Persian

text: I'm typing my thesis in Farsi, and I'm using LiveTeX. I want to change my font in some parts of my documents. I checked most of the relevant questions and answers but unfortunately I couldn't find out my answer. There are two questions:   1. How can I change the font of some specific parts of my thesis?    2. What are font families?  I already used `{\fontfamily{ppl}\selectfont ... }` but it didn't work. I used it as:               \documentclass[a4]{book}              \usepackage{graphicx}      \newenvironment{ppl}{\fontfamily{ppl}\selectfont}{Times New Roman}     \textwidth =12cm      \textheight =19cm     \usepackage{amsmath,amssymb}      \usepackage{xepersian}     \settextfont[Scale=1]{XB Zar}     \setdigitfont[Scale=1]{XB Zar}           \begin{document}          من این همه را خودم نوشته ام و این یکی را می خواهم به صورت امتحانی در زیر با فونت دیگری بنویسم .                \begin{ppl}     من این را به صورت امتحانی مینویسم .           \end{ppl}     \end{document}


title: Double arrow a la chef with two edges shows gap

text: I am looking for a double arrow that describes a complete 180 degree path. I found a wonderful example, but I have a little issue with one of the edges.               \documentclass{article}     \usepackage{tikz}          \usetikzlibrary{arrows, decorations.markings}     \usetikzlibrary{positioning}          % for double arrows a la chef     % adapt line thickness and line width, if needed     \tikzstyle{vecArrow} = [thick, decoration={markings,mark=at position        1 with {\arrow[semithick]{open triangle 60}}},        double distance=1.4pt, shorten >= 5.5pt,        preaction = {decorate},        postaction = {draw,line width=1.4pt, white,shorten >= 4.5pt}]     \tikzstyle{innerWhite} = [semithick, white,line width=1.4pt, shorten >= 4.5pt]          \begin{document}          %\begin{tikzpicture}[thick]     \begin{tikzpicture}[node distance=1cm]        \node[inner sep=0pt] (pic3) {p3};         %%%% WAS \node        %\node[inner sep=0,minimum size=0,right= 0.5cm of pic3] (inv) {};        % IS NOW \coordinate        \coordinate[inner sep=0pt,minimum size=0,right= 0.5cm of pic3] (inv) {};        \node[inner sep=0pt, below of=pic3] (pic4) {p4};             % 1st pass: draw arrows       %\draw[vecArrow] (a) to (b);       \draw[vecArrow] (pic3) |- (inv) |- (pic4);            % 2nd pass: copy all from 1st pass, and replace vecArrow with innerWhite       %\draw[innerWhite] (a) to (b);       \draw[innerWhite] (pic3) |- (inv) |- (pic4);     \end{tikzpicture}          \end{document}      The result [EDIT: if the old \node is used] was shown on the pic. The right top edge has a little gap. ![enter image description here](http://i.stack.imgur.com/tYTmu.png) How to close this one? [SOLVED: Just use coordinate not node!] Thx Chris


title: Tips and tricks to tightly couple LaTeX paper and Beamer presentation

text: My typical approach is to write the paper in LaTeX, then (in a new file) to write the presentation in Beamer. I am now getting to the point in my education/career where the first version of a paper and presentation won't be the last. The two will evolve together over some (hopefully not too long) period of time. Is there a better way to handle this combined evolution? I already write all graphs and tables to file, so these continuously update, but are there any other techniques that help?


title: modifying part style in memoir class to match ell chapterstyle

text: I've selected ell chapterstyle using the memoir class. Following tips I found in Part style in memoir class and A modification of \part style in memoir and looking at the ell definition in memoir.cls I've gotten fairly close to matching the part style to this chapterstyle:               \documentclass[openany]{memoir}          \chapterstyle{ell}          \renewcommand{\midpartskip}{\begingroup      \vspace*{\beforechapskip}%      \begin{adjustwidth}{}{-\chapindent}%      \hrulefill      \smash{\rule{0.4pt}{15mm}}      \end{adjustwidth}\endgroup}          % numeric instead of roman numeral for the part num:     \renewcommand*{\thepart}{\arabic{part}}     % ell like Fonts:      %      % ragged left: from http://tex.stackexchange.com/questions/42489/a-modification-of-part-style-in-memoir     % (moves the text to the right)     \renewcommand*{\parttitlefont}{\normalfont\huge\sffamily\raggedleft}     \renewcommand*{\partnumfont}{\normalfont\HUGE\sffamily\raggedleft}     \renewcommand*{\partnamefont}{\normalfont\HUGE\sffamily\raggedleft}     % this (without the \beforepartskip of the same form) force the part text higher onto the page.     \renewcommand{\afterpartskip}{\vspace*{\fill}}          \begin{document}          \chapterstyle{ell}     \part{A lot of Foo}     \chapter{Foo}          Foo stuff.          \chapter{Bar}          Bar stuff.          \end{document}      This changes the font to match, and switches from roman numerals, and puts in the ell shaped divider. However, in an ell chapterstyle the description is inline with the L shaped graphic, and I'm not sure how to manage forcing those to not be disjoint. Here's what I get for my ell like part style ![modified memoir part style attempting to match ell chapterstyle](http://i.stack.imgur.com/CpFct.png) compared to the ell chapterstyle format ![ell chapterstyle](http://i.stack.imgur.com/RJIcq.png) The ell chapterstyle in memoir.cls is:               \makechapterstyle{ell}{%       \chapterstyle{default}       \renewcommand*{\chapnumfont}{\normalfont\HUGE\sffamily}       \renewcommand*{\chaptitlefont}{\normalfont\huge\sffamily}       \settowidth{\chapindent}{\chapnumfont 111}       \renewcommand*{\chapterheadstart}{\begingroup         \vspace*{\beforechapskip}%         \begin{adjustwidth}{}{-\chapindent}%         \hrulefill         \smash{\rule{0.4pt}{15mm}}         \end{adjustwidth}\endgroup}       \renewcommand*{\printchaptername}{}       \renewcommand*{\chapternamenum}{}       \renewcommand*{\printchapternum}{%         \begin{adjustwidth}{}{-\chapindent}         \hfill         \raisebox{10mm}[0pt][0pt]{\chapnumfont \thechapter}%                                   \hspace*{1em}         \end{adjustwidth}\vspace*{-3.0\onelineskip}}       \renewcommand*{\printchaptertitle}[1]{%         \vskip\onelineskip         \raggedleft {\chaptitlefont ##1}\par\nobreak}}      Notice that I've used the body of \chapterheadstart in my modified part. I'm not sure what part of this style results in the \chapterheadstart being inline with the chapter number.


title: White space problem using multiple \ifnumequal

text: I am trying to produce slightly different documents based on a single numerical input. But when I use multiple \ifnumequal commands to get the correct bit of text it produces really strange white space around the text. Can you help? I have tried (as below) one \ifnumequal after another, and in nested form, but still the white-space issue. Here is a small example that reproduces the problem.               \documentclass{article}     \usepackage{etoolbox}     \newcounter{N}          \begin{document}          \setcounter{N}{1}     The counter N has been set to      \ifnumequal{\value{N}}{1}{\emph{one}}{}     \ifnumequal{\value{N}}{2}{\emph{two}}{}     \ifnumequal{\value{N}}{3}{\emph{three}}{}     which is nice.          \setcounter{N}{2}     The counter N has been set to      \ifnumequal{\value{N}}{1}{\emph{one}}{}     \ifnumequal{\value{N}}{2}{\emph{two}}{}     \ifnumequal{\value{N}}{3}{\emph{three}}{}     which is nice.          \setcounter{N}{3}     The counter N has been set to      \ifnumequal{\value{N}}{1}{\emph{one}}{}     \ifnumequal{\value{N}}{2}{\emph{two}}{}     \ifnumequal{\value{N}}{3}{\emph{three}}{}     which is nice.          \setcounter{N}{3}     The counter N has been set to      \ifnumequal{\value{N}}{1}{\emph{one}}{     \ifnumequal{\value{N}}{2}{\emph{two}}{     \ifnumequal{\value{N}}{3}{\emph{three}}{}}}     which is nice.          \end{document}


title: Superimposed Boxes in a flowchart with PStricks

text: I'm performing a flowchart using pstricks . The problem is how to do superimposed Boxes (in gray and light gray ) included in the flow chart like those in the picture below . Is there any specific function to produce that ? ![enter image description here](http://i.stack.imgur.com/XFx1J.png) This is what I've done so far ![flowchart](http://i.stack.imgur.com/OZxAK.png)                   \begin{psmatrix}[rowsep=0.4,colsep=0.5]     \psovalbox[fillstyle=solid,fillcolor=yellow,shadow=true]{Begin} \\         \psframebox[shadow=true]{Initialisations} \\         \psdiabox[fillstyle=solid,fillcolor=Pink,shadow=true]{Special} &            \psframebox[shadow=true]{1)} & \psframebox[shadow=true]{2)} \\         \psframebox[shadow=true]{Action 1} \\         ~\\         \psframebox[shadow=true]{Action 2} \\         \psovalbox[fillstyle=solid,fillcolor=yellow,shadow=true]{End}         % Links         \ncline{->}{1,1}{2,1}         \ncline{->}{2,1}{3,1}         \ncline{->}{3,1}{4,1}<{\textcolor{red}{No}}         \ncline{->}{4,1}{6,1}         \ncline{->}{6,1}{7,1}         \ncline{->}{3,1}{3,2}^{\textcolor{red}{Yes}}         \ncline{->}{3,2}{3,3}         \ncbar[angleA=-90,armB=0,nodesepB=0.25]{->}{3,3}{4,1}     \end{psmatrix}       Thank You for your help in advance .


title: Why is the Zero Vector so Big?

text: The `esvect` package seems to produce a zero vector with height larger than I would have expected. The one shown in red is produced using `$\norm*{\Vec{0}}$` and seems to have the delimiters resized larger than needed. I can fix it using either:   * `\norm` instead of `\norm*` or   * `\smash{}` as shown in blue,  but wondering why `$\norm*` seems to think that the zero vector has that much height. ![enter image description here](http://i.stack.imgur.com/haqV0.png) ## Code:               \documentclass{article}     \usepackage{mathtools}     \usepackage{esvect}     \usepackage{xcolor}          \DeclarePairedDelimiter\norm{\lVert}{\rVert}%     \renewcommand*{\Vec}[1]{\vv{\mathbf{#1}}}%     \newcommand*{\U}{\Vec{u}}     \newcommand*{\V}{\Vec{v}}     \newcommand*{\Z}{\Vec{0}}               \begin{document}     \begin{tabular}{@{}c@{}c@{}c@{}c@{}c@{}}     \tiny\verb|\norm*{\V} |  &      \tiny\verb|\norm{\Z} |  &     \tiny\verb|\norm*{\Z} | &     \tiny\verb|\norm*{\smash{\Z}} | &     \tiny\verb|\norm*{\U}|     \\     $\norm*{\V}$  &      $\norm{\Z}$  &     \textcolor{red}{$\norm*{\Z}$} &     \textcolor{blue}{$\norm*{\smash{\Z}}$} &     $\norm*{\U}$     \end{tabular}          \end{document}


title: How to make self-refering arrow with xydigram in a box

text: I'm trying to make a nice state diagram with some arrows I cannot find a way to make the arrows pointing to the same state: in my case, I would like a self-refering arrow to altcache I'm not fixed about the fancybox, but it would nicely fit in the rest of the thesis. Thanks a lot for your help Here is an example of code and the result: ![enter image description here](http://i.stack.imgur.com/GQoyU.jpg) I just need a circle dashed arrow at altcache... * * *               \documentclass{article}     \usepackage{amstext}     \usepackage{fancybox}     \usepackage[all]{xy}          \newcommand{\boxsize}{1.4in}     \newcommand{\state}[1]%       {\doublebox{\text{\begin{minipage}{\boxsize}\centering #1\end{minipage}}}}     \newcommand{\switch}[1]%       {\ovalbox{\text{\begin{minipage}{\boxsize}\centering #1\end{minipage}}}}          \begin{document}          \xymatrix{     \switch{lscache} \ar@{.>}[d] \ar@{.>}[rdd] &  &\\     \switch{tccache} \ar@{.>}[rd] & & \\     \switch{altcache} & \ar@{.>}[l] \switch{cache}  & \\     }          \end{document}


title: color environments influence spacing

text: I would like to mark revised parts of a large document in color, and up to now always used               \usepackage{xcolor}     \newcommand\rev[1]{\textcolor{red}{#1}}      to then do               Lorem ipsum dolor \rev{git} amet, consetetur sadipscing elitr,      This works well, but unfortunately influences the placement of glyphs sometimes, e.g.,               \documentclass{article}          \setlength{\parindent}{0pt}          \usepackage{amsmath}                                                             \usepackage{xcolor}     \newcommand\rev[1]{\textcolor{red}{#1}}          \begin{document}          AV\\     \rev{A}V          \begin{align}     &U \oplus V\\     &U \rev{\oplus} V     \end{align}          \end{document}      gives ![AV spacing](http://i.stack.imgur.com/0L4Qu.png) ![oplus spacing](http://i.stack.imgur.com/TL798.png) What is a better way of coloring parts of a document?


title: Linking the section titles to toc using only hyperref

text: How to link section titles back to toc? I want to use _only_ `hyperref` and not any toc related packages (answer with `titlesec` can be found here) I can do the `hypertarget` to toc sections (answer provided by cmhughes and shown in the MWE below). Thus, my question really is: where to put the `hyperlink` line?               \documentclass{report}     \usepackage{hyperref}          \let\oldcontentsline\contentsline%     \renewcommand\contentsline[4]{%     \hypertarget{toc#4}{}%     \oldcontentsline{#1}{#2}{#3}{#4}}          \begin{document}     \tableofcontents     \chapter{A Chapter to act as a Link}     \section{A Section to act as a Link}     \end{document}


title: PDF4Eclipse - How to set it as a default viewer

text: I am using Texlipse to write my dissertation and came across the PDF4Eclipse pdf viewer this morning. I installed it (was easy) but I cannot figure out how to set it as the default pdf viewer. At the moment Preview (Mac os X) is used as the default. I know that I can change the default viewer by going to Eclipse -> Preferences -> Texlipse -> Viewer settings but at the viewer command it ask to select a path to the viewer. However I cannot find any pdf4eclipse executable file on my system... I can, however, use right click on a pdf file and open with -> pdf viewer which then uses the PDF4Eclipse and opens it within Eclipse. However, I cannot be bother to go through that procedure to to open my pdfs with the internal PDF4Eclipse viewer. Any advise is very much appreciated. Many thanks josh


title: sidewaysfigure with non-rotated section-title

text: I have a `sidewaysfigure` with consisting of 6 subfigures. As this is the first figure that appear in my appendix, I need to have a non-rotatet section- title. Following this question Rotating: Sideways figure with Section title I tried to put my figure in a `minipage`. But the result is that I have half of the figure on top (cut-off) and then in the middle of the page the section title. I give u an example:               %General Layout     \documentclass[a4paper, 12pt]{article}     \usepackage[left=3cm, right=2cm, top=3cm, bottom=4cm]{geometry}          %Font encoding     \usepackage[T1]{fontenc}          %Font     \usepackage[utf8]{inputenc}          %Language     \usepackage[english]{babel}          %Graphs and Diagrams     %\usepackage{subgraphic}     \usepackage{subfig}     \usepackage[demo]{rotating} %remove 'demo' option for real file     \usepackage{tikz}     \usepackage[outdir=./]{epstopdf}     \usepackage{graphicx}     \usepackage{float}     \usepackage{pdfpages}               %Tables     \usepackage{multirow}     \usepackage{longtable}     \usepackage{booktabs}     \usepackage{tabulary}     \usepackage{tabularx}     \usepackage{fixltx2e}     \usepackage{threeparttable}     \usepackage{threeparttablex}     \usepackage{pdflscape, longtable}     \usepackage{hvfloat}          \usepackage[labelsep=newline,% line break after label        justification=centering,        singlelinecheck=off, font=bf]{caption}          %%%%\usepackage[labelfont=md]{subcaption}     \usepackage{siunitx}     \usepackage{etoolbox}     \robustify\bfseries      \sisetup{detect-weight=true,detect-inline-weight=math}     \usepackage{fancybox}     \usepackage{array}               \usepackage{dcolumn}     \newcolumntype{d}[1]{D{.}{.}{#1}}     \newcommand\mc[1]{\multicolumn{1}{c}{#1}}     \usepackage{colortbl}     \makeatletter% Set distance from top of page to first float     \setlength{\@fptop}{5pt}     \makeatother          %%%%%%%%%% Journal Conventions %%%%%%%%%%     \renewcommand{\thesection}{\Roman{section}}      \renewcommand{\thesubsection}{\Alph{subsection}}      \renewcommand{\thetable}{\Roman{table}}      \renewcommand{\abstractname}{\textsc{ABSTRACT}}     \makeatletter     % we need a period (.) after sectioning numbers, but not in cites thereto.     \renewcommand{\@seccntformat}[1]{{\csname the#1\endcsname}.\hspace{0.5em}}          \long\def\@makefigcaption#1#2{%      \vskip\abovecaptionskip      %#1\\\footnotesize#2      %\sbox\@tempboxa{\footnotesize\bf#1.\footnotesize#2}%      %\sbox\@tempboxa{\footnotesize{\textbf{#1.}} footnotesize#2}%      %\sbox\@tempboxa{\textbf{#1.} footnotesize#2}%      %\sbox\@tempboxa      \footnotesize\textbf{#1.} \footnotesize#2      \ifdim \wd\@tempboxa >\hsize      \textbf{#1.} #2\par      \else       \global \@minipagefalse       \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%      \fi      \vskip\belowcaptionskip}           \renewcommand{\figure}{\let\@makecaption\@makefigcaption\@float{figure}}          \long\def\@maketblcaption#1#2{%      \vskip\abovecaptionskip %Same size for Numbering and Caption of Tables      \begin{center}\normalsize\bf#1\\\normalsize#2\end{center}     % \sbox\@tempboxa{\textbf{#1.} #2}%     % \global \@minipagefalse     % \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%      \vskip\belowcaptionskip}           \renewcommand{\table}{\let\@makecaption\@maketblcaption\@float{table}}     %\renewcommand{\sidewaystable}{\let\@makecaption\@maketblcaption\@float{sidewaystable}}          \makeatother          \begin{document}          \section{Appendix}     \captionsetup[subfloat]{labelfont=md}     \centering     \begin{figure}     \begin{minipage}[b][15cm][b]{15cm}     \begin{turn}{90}     %\caption{Cumulated Average Index-Adjusted CDS Return for Extreme Earnings Decile Portfolios \label{fig:CASC}}     %\begin{minipage}{\textheight}     %\footnotesize test test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test test      %\bigskip     %\end{minipage}     \subfloat[DSUE1 $-$ Full Sample]{\includegraphics[width=0.31\textheight]{aasc_full_dsue1.eps}\label{fig:fullDSUE1}} \quad \bigskip     \subfloat[DSUE2 $-$ Full Sample]{\includegraphics[width=0.31\textheight]{aasc_full_dsue2.eps}\label{fig:fullDSUE2}}\quad      \subfloat[DSUE3 $-$ Full Sample]{\includegraphics[width=0.31\textheight]{aasc_full_dsue3.eps}\label{fig:fullDSUE3}} \quad \\     \subfloat[DSUE1 $-$ Pre-Crisis]{\includegraphics[width=0.31\textheight]{aasc_precrisis_dsue1.eps}\label{fig:preDSUE1}} \quad      \subfloat[DSUE2 $-$ Pre-Crisis]{\includegraphics[width=0.31\textheight]{aasc_precrisis_dsue2.eps}\label{fig:preDSUE2}}\quad      \subfloat[DSUE3 $-$ Pre-Crisis]{\includegraphics[width=0.31\textheight]{aasc_precrisis_dsue3.eps}\label{fig:preDSUE3}} \quad      %\begin{minipage}{\textheight}     %\bigskip     %Figure continues on next page     %\bigskip     %\end{minipage}     \end{turn}     \end{minipage}     \end{figure}          \end{document}      Furthermore, when I use `sidewaysfigure` the figures are equally "distributed" in a 2x3 (sideways view). Using the `minipage` environment just cuts them off. Additionally, I would like to have the subcaptions in non-bold while the caption in bold. I tried to it with loading the `subcaption` package with `labelfont=md` options as well as directly "in front" of the figure with `\captionsetup[subfloat]{labelfont=md}` (and [sidewaysfigure]}. But the subcaption of my subfigure are still bold. thank you very much edit: this is the code I am trying to compile:               %General Layout     \documentclass[a4paper, 12pt]{article}     \usepackage[left=3cm, right=2cm, top=3cm, bottom=4cm]{geometry}          %Font encoding     \usepackage[T1]{fontenc}          %Font     \usepackage[utf8]{inputenc}          %Language     \usepackage[english]{babel}          %Graphs and Diagrams     %\usepackage{subgraphic}     \usepackage{subfig}     \usepackage[demo]{rotating} %remove 'demo' option for real file     \usepackage{tikz}     \usepackage[outdir=./]{epstopdf}     \usepackage{graphicx}     \usepackage{float}     \usepackage{pdfpages}               %Tables     \usepackage{multirow}     \usepackage{longtable}     \usepackage{booktabs}     \usepackage{tabulary}     \usepackage{tabularx}     \usepackage{fixltx2e}     \usepackage{threeparttable}     \usepackage{threeparttablex}     \usepackage{pdflscape, longtable}     \usepackage{hvfloat}          \usepackage[labelsep=newline,% line break after label        justification=centering,        singlelinecheck=off, font=bf]{caption}          %%%%\usepackage[labelfont=md]{subcaption}     \usepackage{siunitx}     \usepackage{etoolbox}     \robustify\bfseries      \sisetup{detect-weight=true,detect-inline-weight=math}     \usepackage{fancybox}     \usepackage{array}               \usepackage{dcolumn}     \newcolumntype{d}[1]{D{.}{.}{#1}}     \newcommand\mc[1]{\multicolumn{1}{c}{#1}}     \usepackage{colortbl}     \makeatletter% Set distance from top of page to first float     \setlength{\@fptop}{5pt}     \makeatother          %%%%%%%%%% Journal Conventions %%%%%%%%%%     \renewcommand{\thesection}{\Roman{section}}      \renewcommand{\thesubsection}{\Alph{subsection}}      \renewcommand{\thetable}{\Roman{table}}      \renewcommand{\abstractname}{\textsc{ABSTRACT}}     \makeatletter     % we need a period (.) after sectioning numbers, but not in cites thereto.     \renewcommand{\@seccntformat}[1]{{\csname the#1\endcsname}.\hspace{0.5em}}          \long\def\@makefigcaption#1#2{%      \vskip\abovecaptionskip      %#1\\\footnotesize#2      %\sbox\@tempboxa{\footnotesize\bf#1.\footnotesize#2}%      %\sbox\@tempboxa{\footnotesize{\textbf{#1.}} footnotesize#2}%      %\sbox\@tempboxa{\textbf{#1.} footnotesize#2}%      %\sbox\@tempboxa      \footnotesize\textbf{#1.} \footnotesize#2      \ifdim \wd\@tempboxa >\hsize      \textbf{#1.} #2\par      \else       \global \@minipagefalse       \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%      \fi      \vskip\belowcaptionskip}           \renewcommand{\figure}{\let\@makecaption\@makefigcaption\@float{figure}}          \long\def\@maketblcaption#1#2{%      \vskip\abovecaptionskip %Same size for Numbering and Caption of Tables      \begin{center}\normalsize\bf#1\\\normalsize#2\end{center}     % \sbox\@tempboxa{\textbf{#1.} #2}%     % \global \@minipagefalse     % \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%      \vskip\belowcaptionskip}           \renewcommand{\table}{\let\@makecaption\@maketblcaption\@float{table}}     %\renewcommand{\sidewaystable}{\let\@makecaption\@maketblcaption\@float{sidewaystable}}          \makeatother          \begin{document}          \section{Appendix}     \captionsetup[subfloat]{labelfont=md}     \centering     \begin{figure}     \begin{minipage}[b][15cm][b]{15cm}     \begin{turn}{90}     %\caption{Cumulated Average Index-Adjusted CDS Return for Extreme Earnings Decile Portfolios \label{fig:CASC}}     %\begin{minipage}{\textheight}     %\footnotesize test test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test test      %\bigskip     %\end{minipage}     \subfloat[DSUE1 $-$ Full Sample]{\includegraphics[width=0.31\textheight]{aasc_full_dsue1.eps}\label{fig:fullDSUE1}} \quad \bigskip     \subfloat[DSUE2 $-$ Full Sample]{\includegraphics[width=0.31\textheight]{aasc_full_dsue2.eps}\label{fig:fullDSUE2}}\quad      \subfloat[DSUE3 $-$ Full Sample]{\includegraphics[width=0.31\textheight]{aasc_full_dsue3.eps}\label{fig:fullDSUE3}} \quad \\     \subfloat[DSUE1 $-$ Pre-Crisis]{\includegraphics[width=0.31\textheight]{aasc_precrisis_dsue1.eps}\label{fig:preDSUE1}} \quad      \subfloat[DSUE2 $-$ Pre-Crisis]{\includegraphics[width=0.31\textheight]{aasc_precrisis_dsue2.eps}\label{fig:preDSUE2}}\quad      \subfloat[DSUE3 $-$ Pre-Crisis]{\includegraphics[width=0.31\textheight]{aasc_precrisis_dsue3.eps}\label{fig:preDSUE3}} \quad      %\begin{minipage}{\textheight}     %\bigskip     %Figure continues on next page     %\bigskip     %\end{minipage}     \end{turn}     \end{minipage}     \end{figure}          \end{document}      EDIT: here is a reduced version (I just commented out all packages from which I know it would worked without).               %General Layout     \documentclass[a4paper, 12pt]{article}     \usepackage[left=3cm, right=2cm, top=3cm, bottom=4cm]{geometry}          %Font encoding     \usepackage[T1]{fontenc}          %Font     \usepackage[utf8]{inputenc}          %Language          %Graphs and Diagrams     %\usepackage{subgraphic}     \usepackage{subfig}     \usepackage[demo]{rotating} %remove 'demo' option for real file     \usepackage[outdir=./]{epstopdf}     \usepackage{graphicx}     \usepackage{float}          %\usepackage[labelsep=newline,% line break after label     %   justification=centering,     %   singlelinecheck=off, font=bf]{caption}          \usepackage{caption}          \begin{document}          \section{Appendix}     \centering     \begin{figure}     \begin{minipage}[b][15cm][b]{15cm}     \begin{turn}{90}     \subfloat[DSUE1 $-$ Full Sample]{\includegraphics[width=0.31\textheight]{aasc_full_dsue1.eps}\label{fig:fullDSUE1}} \quad \bigskip     \subfloat[DSUE2 $-$ Full Sample]{\includegraphics[width=0.31\textheight]{aasc_full_dsue2.eps}\label{fig:fullDSUE2}}\quad      \subfloat[DSUE3 $-$ Full Sample]{\includegraphics[width=0.31\textheight]{aasc_full_dsue3.eps}\label{fig:fullDSUE3}} \quad \\     \subfloat[DSUE1 $-$ Pre-Crisis]{\includegraphics[width=0.31\textheight]{aasc_precrisis_dsue1.eps}\label{fig:preDSUE1}} \quad      \subfloat[DSUE2 $-$ Pre-Crisis]{\includegraphics[width=0.31\textheight]{aasc_precrisis_dsue2.eps}\label{fig:preDSUE2}}\quad      \subfloat[DSUE3 $-$ Pre-Crisis]{\includegraphics[width=0.31\textheight]{aasc_precrisis_dsue3.eps}\label{fig:preDSUE3}} \quad      \end{turn}     \end{minipage}     \end{figure}          \end{document}      and that is the output: ![enter image description here](http://i.stack.imgur.com/JB1Vx.png) ant that is what I would like to achieve (Note I painted the section-title manually): ![enter image description here](http://i.stack.imgur.com/EDjPw.png) EDIT: Here is the example that is almost what I wanted. Now the question arises on how to modify the caption just(!) for figures: I need them to be bold and left aligned while captions for my tables are supposed to be centered (therefore, I global definition might not be possible).               %General Layout     \documentclass[a4paper, 12pt]{article}     \usepackage[left=3cm, right=2cm, top=3cm, bottom=4cm]{geometry}          %Font encoding     \usepackage[T1]{fontenc}          %Font     \usepackage[utf8]{inputenc}          %Language     \usepackage[english]{babel}          \usepackage{rotating}     \usepackage[outdir=./]{epstopdf}     \usepackage{graphicx}     \usepackage{float}     \usepackage{pdfpages}          \usepackage[labelsep=newline,% line break after label        justification=centering, labelsep=period,        singlelinecheck=off, font=bf]{caption}          \usepackage{subcaption}          \makeatletter% Set distance from top of page to first float     \setlength{\@fptop}{5pt}     \makeatother          %%%%%%%%%% Journal of Finance %%%%%%%%%%          %These conventions are taken from Jiri Woschitz and Guido Rosenast          \renewcommand{\thesection}{\Roman{section}}      \renewcommand{\thesubsection}{\Alph{subsection}}      \renewcommand{\thetable}{\Roman{table}}      \renewcommand{\abstractname}{\textsc{ABSTRACT}}     \makeatletter     % we need a period (.) after sectioning numbers, but not in cites thereto.     \renewcommand{\@seccntformat}[1]{{\csname the#1\endcsname}.\hspace{0.5em}}          \long\def\@makefigcaption#1#2{%      \vskip\abovecaptionskip      %#1\\\footnotesize#2      %\sbox\@tempboxa{\footnotesize\bf#1.\footnotesize#2}%      %\sbox\@tempboxa{\footnotesize{\textbf{#1.}} footnotesize#2}%      %\sbox\@tempboxa{\textbf{#1.} footnotesize#2}%      %\sbox\@tempboxa      \footnotesize\textbf{#1.} \footnotesize#2      \ifdim \wd\@tempboxa >\hsize      \textbf{#1.} #2\par      \else       \global \@minipagefalse       \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%      \fi      \vskip\belowcaptionskip}           \renewcommand{\figure}{\let\@makecaption\@makefigcaption\@float{figure}}          \long\def\@maketblcaption#1#2{%      \vskip\abovecaptionskip %Same size for Numbering and Caption of Tables      \begin{center}\normalsize\bf#1\\\normalsize#2\end{center}     % \sbox\@tempboxa{\textbf{#1.} #2}%     % \global \@minipagefalse     % \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%      \vskip\belowcaptionskip}           \renewcommand{\table}{\let\@makecaption\@maketblcaption\@float{table}}     %\renewcommand{\sidewaystable}{\let\@makecaption\@maketblcaption\@float{sidewaystable}}     \makeatother          \setlength{\abovecaptionskip}{0.1cm}     \setlength{\belowcaptionskip}{-2mm}          %%%%%%%%%% End: Journal of Finance%%%%%%%%%%          \captionsetup[subfigure]{font=md}          \begin{document}          \tableofcontents     \listoffigures     \listoftables     \newpage          \section{Appendix}                 \centering       \begin{figure}[htp]       \begin{minipage}{\textwidth}         \section{Appendix} \bigskip \bigskip \bigskip       \end{minipage}         \begin{turn}{90}               \begin{minipage}{0.85\textheight}            \caption{Cumulated Average Index-Adjusted CDS Return for Extreme Earnings Decile Portfolios \label{fig:CASC}} \vspace{-3mm}     testestestt estestestteste stesttestestesttestestesttestestesttestestes     testestesttestest esttestestestteste stesttes testestvtestestest     testestesttestestestt estestesttestestestteste stesttestestesttesteste     testestestte stestesttestestesttestestesttestestesttestestest \bigskip \bigskip \\     \subfloat[DSUE1 $-$ Full Sample]{\includegraphics[width=0.27\textheight]{aasc_full_dsue1.eps}\label{fig:fullDSUE1}} \quad \bigskip     \subfloat[DSUE2 $-$ Full Sample]{\includegraphics[width=0.27\textheight]{aasc_full_dsue2.eps}\label{fig:fullDSUE2}} \quad     \subfloat[DSUE3 $-$ Full Sample]{\includegraphics[width=0.27\textheight]{aasc_full_dsue3.eps}\label{fig:fullDSUE3}} \quad      \subfloat[DSUE1 $-$ Pre-Crisis]{\includegraphics[width=0.27\textheight]{aasc_precrisis_dsue1.eps}\label{fig:preDSUE1}} \quad     \subfloat[DSUE2 $-$ Pre-Crisis]{\includegraphics[width=0.27\textheight]{aasc_precrisis_dsue2.eps}\label{fig:preDSUE2}} \quad      \subfloat[DSUE3 $-$ Pre-Crisis]{\includegraphics[width=0.27\textheight]{aasc_precrisis_dsue3.eps}\label{fig:preDSUE3}} \quad      \end{minipage}     \end{turn}     \end{figure}          \end{document}      ![enter image description here](http://i.stack.imgur.com/2NgVK.png)


title: LaTex variable inside gnuplot code

text: I just started using gnuplot code inside my latex document and I just ran into a problem I could not solve after some googling (hit me if I did not google hard enough). I use the gnuplottex package. The thing I want to do is multiple plots in my latex document with gnuplot. As some plots treat of related data, I want to use the same colors/linestyle for related data (in this case color). As I am lazy, I just want to declare once the color I want to use in hexacode in LaTex and then use it in every gnuplot command. For instance:               \documentclass[12pt, a4]{article}     \usepackage[utf8]{inputenc}     \usepackage{graphicx}     \usepackage[url=false, doi=false, isbn=false, sorting=none,style=numeric,maxbibnames=3,maxcitenames=3,backend=bibtex]{biblatex}     \usepackage{gnuplottex}     \newcommand{\myredcolor}{\#FF6666}     \begin{document}      And then :                \begin{gnuplot}      set terminal epslatex      plot   "mydata"  title "\\myredcolor" with linespoints linestyle 1 lt rgb "\\myredcolor" lw 3      \end{gnuplot}      Thing is, obviously, it does not work. In this case, if the plot would appear (ie when putting "red" instead of "\myredcolor" for instance), the title of my plot would correctly be "#FF6666", meaning that I managed to pass my variable gnuplot for the "title" value but not for the rgb value, as the plot won't appear if I leave it like this. Is there any way to solve this, or will I have to hardcode the hexa value in each of my plot command for this related data ? Just to try, I also checked for linestyle (in case something was amiss with the # sign) and this wouldn't work either :               \newcommand{\mylinestyle}{1}      And then :                \begin{gnuplot}      set terminal epslatex      plot   "mydata"  title "MyData \\mylinestyle" with linespoints linestyle \\mylinestyle lt rgb "red" lw 3      \end{gnuplot}      \end{document}      Thanks a lot


title: Color box with rounded corners around a fragment of a formula

text: Is there any way in TeX to highlight some part of a formula with a box having colored background and rounded corners? At present, I need to export such formulas into an image, add those highlight boxes in GIMP, and import back into the document as an image. But this is a mess, and I need to redo all of that every time I change anything in these formulas :/ So it'd be better if I could mark up those fragments of my formulas in LaTeX natively. Is it possible? I saw one example of boxes made with TikZ package, but I couldn't figure out how does it work and how to assimilate it into my own document. I don't want to make floating boxes inside a document, but just around a fragment of a formula to highlight it. (No, I cannot use text colors for that, because this text already has some colors which means something else, so I need to use background color instead.) **Edit 1** Here's the effect I'd like to achieve: ![http://sasq.comyr.com/Stuff/WaveFunc1D_pE_my.png](http://i.stack.imgur.com/Oq9fd.png) **Edit 2** OK, after suggestions from A.Ellet below, I came out with the following code:               \documentclass{article}     \pagestyle{empty}     \usepackage{color}     \usepackage{amsmath}     \usepackage{fancybox}     \usepackage[usenames,dvipsnames]{xcolor}     \definecolor{My}{RGB}{0,31,63}     \definecolor{MyConst}{RGB}{128,128,128}     \definecolor{MyFunc}{RGB}{0,75,107}     \definecolor{MyIndep}{RGB}{127,55,0}     \definecolor{MySubst}{RGB}{250,230,230}     \newcommand{\const}[1]{{\color{MyConst}\mathrm{#1}}}     % normal constant     \newcommand{\uconst}[1]{\mathrm{#1}}                     % universal mathematical constant     \newcommand{\var}[1]{{\color{MyIndep}#1}}                % independent variable     \newcommand{\subst}[1]{{\colorbox{MySubst}#1}}           % substitution          \begin{document}     $$\color{My}     {\color{MyFunc}\Psi} =     \const{\Psi_{_0}}\;     \uconst{e}^{\uconst{i} \left(         \colorbox{MySubst!50}{             \frac{p}{\const{\hbar}}         }   % line 24         \var{x} - \frac{E}{\const{\hbar}}\var{t} \right) }     $$     \end{document}      which doesn't work. It throws errors like:               ! Missing $ inserted.     <inserted text>                      $     l.24    }      (I marked the line 24 with a comment.) When I remove the `\frac` from inside the box and replace it by just `x`, it starts to work, but apparently from the formatting it seems to treat is as plain text instead of math. **Edit 3** Here's your code editted to work:               \documentclass{article}     \pagestyle{empty}     \usepackage{color}     \usepackage{amsmath}     \usepackage{fancybox}     \usepackage[usenames,dvipsnames]{xcolor}     \definecolor{My}{RGB}{0,31,63}     \definecolor{MyConst}{RGB}{128,128,128}     \definecolor{MyFunc}{RGB}{0,75,107}     \definecolor{MyIndep}{RGB}{127,55,0}     \definecolor{MySubst}{RGB}{250,230,230}     \newcommand{\const}[1]{{\color{MyConst}\mathrm{#1}}}     % normal constant     \newcommand{\uconst}[1]{\mathrm{#1}}                     % universal mathematical constant     \newcommand{\var}[1]{{\color{MyIndep}#1}}                % independent variable     \newcommand{\subst}[1]{\colorbox{MySubst}{#1}}           % substitution          \begin{document}     \[     \color{My}{\color{MyFunc}}\Psi =     \const{\Psi_{_0}}\;     \uconst{e}^{             \uconst{i}              \left(                 \colorbox{MySubst!50}{$\frac{p}{\const{\hbar}}$}                 \var{x} - \frac{E}{\const{\hbar}}                 \var{t}              \right)          }     \]     \end{document}


title: How to keep a code in a bbl file?

text: In my previously asked question about changing the chaptermark in a bibliography, I got a nice answer but unfortunately I need to place the code in my BBL file. This means I need to rewrite my code every run. Is there a solution for this, new, problem? My first problem was: I'm writing my thesis. The references span across multiple pages. On the top of the second (and further) page there is a header (that appears on every page where a new chapter does not begin). The header informs a reader about the current chapter he/she is reading. But in the references it says "Algemene conclusies", which is my last chapter. I would like this not to appear in the references and say "Bibliografie" instead. This is my code for the preamble:                   \documentclass[11pt, a4paper, twoside, openright]{report}          %\usepackage[left=2.5cm,top=3cm,right=2.5cm,bottom=3cm]{geometry}     \usepackage[a4paper,inner=3.2cm,outer=2cm,top=2cm,bottom=1.5cm,includehead,includefoot]{geometry}          \usepackage{xspace}     \usepackage{setspace} \onehalfspacing     \usepackage[dutch]{babel}     \usepackage{graphicx}     \usepackage[latin1]{inputenc}     \usepackage{subfigure}     \usepackage{appendix}     \usepackage{amsmath}     \usepackage{pdfpages}     \usepackage{pdflscape}     \usepackage{capt-of}     \usepackage{longtable}     \usepackage[square]{natbib}     \usepackage{lscape}     \usepackage{url}     \usepackage{tocvsec2}     \usepackage[hang,small,bf]{caption}     \usepackage{pslatex}     \usepackage{titlesec}     \usepackage{fancyhdr}     \pagestyle{fancy}     \headheight = 14pt     \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \renewcommand{\sectionmark}[1]{\markright{#1}{}}     \fancyhf{}     \fancyhead[LE,RO]{\thepage}     \fancyhead[RE]{\textit{\nouppercase{\leftmark}}}     \fancyhead[LO]{\textit{\nouppercase{\rightmark}}}          %\renewcommand{\sectionmark}[1]{\markright{#1}}      %\fancyhead[LO]{\nouppercase{\leftmark}}     %\fancyhead[LE]{\nouppercase{\rightmark}}     %\fancyhead[HR]{\thepage}     \renewcommand{\headwidth}{16cm}      \renewcommand{\baselinestretch}{1.2}          \setlength{\parindent}{0cm}     \setlength{\parskip}{2.3ex plus 0.3ex minus 0.3ex}          \usepackage{pstricks}     \makeatletter     \def\LigneVerticale{\vrule height 2cm depth 2cm\hspace{0.1cm}\relax}     \def\LignesVerticales{%     \let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}     \def\GrosCarreAvecUnChiffre#1{%     \rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%     \rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%     \vrule height 0pt width 1cm depth 0pt}     \def\@makechapterhead#1{\hbox{%     \huge     \LignesVerticales     \hspace{-0.5cm}%     \GrosCarreAvecUnChiffre{\thechapter}     \hspace{0.2cm}\hbox{#1}%     }\par\vskip 2cm}     \def\@makeschapterhead#1{\hbox{%     \huge     \LignesVerticales     %\hspace{0.5cm}%     \hbox{#1}%     }\par\vskip 2cm}      This is my file:               \chapter{Algemene conclusies}     \input{Conclusie}     \newpage          \clearpage{\pagestyle{empty}\cleardoublepage}     \addcontentsline{toc}{chapter}{Bibliografie}     \input{Bibliografie}      and this is the code in the file Bibliografie:               \bibliography{bronnen}        \bibliographystyle{agsm}%plainnat


title: Disable chapter separation in \listoffigures and \listoftables

text: I use `\listoffigures` and `\listoftables`. Both commands create line breaks for items from different chapters. How can you stop that? Screenshot: ![enter image description here](http://i.stack.imgur.com/7TDrp.png)


title: amsmath, vec and if not working together

text: I am trying to define some macros in which I need an "if" which test contains an argument of the macro. The issue arises when this argument is `\vec{<arg>}` and the `amsmath` package is loaded. Here is a minimal working example:               \documentclass{article}     \begin{document}     $\if\vec{x}\empty true\else false\fi$     \end{document}      and here is a minimal non-working example:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     $\if\vec{x}\empty true\else false\fi$     \end{document}      I would be happy to understand what causes the errors in the definition of vec by the amsmath package, and how to fix it. To give you more information, I create the macro:               \newcommand*\ifpresent[2]{\expandafter\if#1\empty\else#2\fi}      and I want               $\ifpresent{\ifpresent{x}{a}}{b}$      to write "b", and               $\ifpresent{\ifpresent{}{a}}{b}$      to write nothing. I also tried:               \newcommand*\ifpresent[2]{\expandafter\ifx#1\empty\else#2\fi}      but in this case               $\ifpresent{\ifpresent{x}{a}}{b}$      gives me the "Extra `\else`" and "extra `\fi`" errors. What I want then is to define macros like               \newcommand\foo[1]{\ifpresent{#1}{foo#1}}      and               \newcommand\bar[1]{\ifpresent{#1}{bar#1}}      such that               \foo{\bar{}}      gives nothing and               \foo{\bar{yeah}}      gives "foobaryeah"


title: Difference between 11 and 12 catcodes

text: I can only define commands, consisting of catcode-11 symbols or single catcode-12. _What is the point of this limitation?_ It would be convient for me to define commands, that include following, not used symbols: `!@№:;?*.#-` and, probably a lot of unicode punctuation(I care only about `xelatex`). Of course, I can do it in my own package internals, but if I want to export such unconventional macros, I have to say to user to change catcode. But it seems nobody do such. I do not see, how it would cause problems.


title: LaTex => ps => pdf

text: Hi I have just installed texniccenter on my new computer and i am trying to use LaTex => ps => pdf profile as i was using this my old computer. I checked all profile settings from output profile and they match settings of my old computer. However for some reason, the `.pdf` file is not being created. THe only files created are `.aux`, `.bbl`, Performance monitor file, `.dvi`, Text, and `.dwg` TrueView PostScript Support file. Can someone help me with this please? Thanks!


title: Package to create a printable form

text: I need to create a printable form. Please suggest a LaTeX package that can do these types of questions:   * Text:               1. Your e-mail: __________________________        * Paragraph:               2. Describe your neighborhood:          _____________________________     _____________________________     _____________________________        * Choose one:               3. Your one most favorite fruit:          () Apple   () Pear     () Orange  () Other: ___________        * Choose many:               4. Pick two fruits that you love least of all:          [] Apple  [] Pear     [] Orange [] Other: ___________        * Grid:               5. Rate your attitude to these fruits:                  Hate   Don't like  Indifferent   Like   Love     Apple    ()         ()         ()         ()     ()     Orange   ()         ()         ()         ()     ()     Pear     ()         ()         ()         ()     ()      _Update:_ I've edited the question to remove misleading word "questionnaire". I need forms, to get statistics from, not exams and quizzes. Sorry, I'm a bit lost at the English terminology on the subject. See above examples to better understand what I need.


title: aligning bottom of two tables

text: I need to align the bottom of these two tables, and I need to add a brace to each side of the second table.. how can I do that?               \begin{figure}[]      \centering       \subfloat[]{        \begin{tabular}{cc}       \hline       0 & 1\\       \hline       2 & 1\\       3 & 1\\       4 & 2\\       5 & 3\\       4 & 8\\       \hline       \end{tabular}       }         \subfloat[]{       \begin{tabular}{cc}       \hline       1 & 2\\       \hline       3 & 7\\       4 & 5\\       \hline       \end{tabular}       }     \end{figure}      Any help appreciated, Ted.


title: What are some good examples of LaTeX Cayley diagrams?

text: I'm looking for some good examples of LaTeX code used to generate basic Cayley diagrams like this one: ![D4 Group Diagram](http://i.stack.imgur.com/C2D9Y.png) Ideally, I'd like for the examples to make it fairly clear how to modify or remove various elements of the graph (labels, colors, line styles, etc.), and how to produce graphs for different basic groups.


title: refer to theorems in previous chapter

text: I have separated my thesis in separated latex files representing the chapters of my text. When I refer to theorems in previous chapters I only get the exact number of the theorem, hence one does not know to which chapter it belongs. Is it possible to get the chapter number in roman style before the theorem number? Hopefully still using the command \ref{} ... Example, in section 2 of chapter 1 I have a theorem with label X and number 2.1 (the 2 stands for the section number and 1 for the theorem number in that section). I refer to it in chapter 5, e.g. "by theorem \ref{X}, we obtain ...". The result then is "by theorem 2.1, we obtain ...".


title: Horizontal spacing after cases bracket in equation

text: How can I add a little horizontal spacing after the cases bracket, at the depicted position, so that 1 and 0 move to the right (the given screenshot looks okayish, but I'm using a different font where the spacing is too tight): ![casesSpacing](http://i.stack.imgur.com/EnIPq.png) MWE:               \documentclass[ngerman]{scrbook}     \usepackage{amsmath}     \begin{document}     \begin{equation}         f(x) =          \begin{cases}           1 & \text{if } x \text{ is even}\\           0 & \text{else}         \end{cases}     \end{equation}     \end{document}


title: Adding Non-breaking space after single character in text mode

text: Is it possible in LaTeX (2e) to create macro or other processing command that will add non-breaking space after single character in text mode? Example:               A new example here will add a "tilde", after single letter, but will skip math mode.     $12 \times A = 128$      should produce:               A~new example here will add a~"tilde", after single letter, but will skip math mode.     $12 \times A = 128$      I know that I can use regular expresion like: `s/\\(\<[a-z]\>\\)[ ]/\1\~/g`, but this one will also change text in math mode and listing/verbatim mode.


title: Use cmbright with unicode text under XeLaTeX

text: XeLaTeX has been my preferred LaTeX engine because it straightforwardly handles text in Unicode (UTF-8 encoding). I know this can be done using `\usepackage[utf8]{inputenc}` with other engines, too, but it appears to me that the handling in XeLaTeX is more uniform, less of a hack; and I'm also fond of its capability to use OpenType fonts. Now in a new document I chose to use Computer Modern Bright via `\usepackage{cmbright}` but found that I cannot access characters by directly typing in Unicode. Meaning "---" works, but "—" does not, the same for "\´a" vs "á" etc. First I thought this is because I did not load `fontspec`, and it's true that as soon as I load the package, unicode works – just not with Computer Modern Bright. If I load `fontspec` before `cmbright` I get Latin Modern Roman, if after: Latin Modern Sans. Is there any way to make this work?


title: How do I put keywords after abstract in amsart?

text: I'm using amsart and want to place keywords after abstract but amsart places them in the footnote. Does anyone know how Ι can override this? An example of the code I've been using:               \documentclass[12pt, reqno]{amsart}     \usepackage{ amsthm, amscd, amsfonts, amssymb, graphicx,tikz, color, environ}     \usepackage{hyperref}     \begin{document}          \title     \address     \date     \keywords     \maketitle          \begin{abstract}          \end{abstract}          \end{document}


title: Right-aligning text over expression

text: Basically, I want something like this:               $$ \overset{\qquad\quad\; 2}{\sqrt{x+x^2}} $$      where the expression above is (automatically) right-aligned, but I have no idea how to achieve this. (The example above is manually spaced, I want it to be automatic.)


title: Rotating curve by 360 degrees properly with TikZ

text: I'm writing about the volume by an integral, and I had to draw this. ![enter image description here](http://i.stack.imgur.com/3xTrn.png) How do I draw it properly? Here is my codes:               \documentclass[10pt]{article}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows}     \usepackage[lmargin=3cm,rmargin=2cm,tmargin=2cm,bmargin=1.7cm]{geometry}          \begin{document}          \begin{tikzpicture}[scale=0.6]     \draw[->] (-1,0) -- (25,0) node[right] {$x$};     \draw (0,0) -- (4,0) -- (4,1.93) -- cycle;     \draw[dashed] (0,0) -- (4,0) -- (4,-1.93) -- cycle;     \draw[dashed,sloped] (4,-1.93) .. controls (3.3,0) .. (4,1.93) ;     \draw[dashed,sloped] (4,-1.93) .. controls (4.7,0) .. (4,1.93) ;          \draw[sloped] (5,0) .. controls (6.19,1.86) and (7.74,1.12) .. (8.2,1.83) ;     \draw[sloped,dashed] (5,0) .. controls (6.19,-1.86) and (7.74,-1.12) .. (8.2,-1.83) ;     \draw[dashed,sloped] (8.2,-1.83) .. controls (8.7,0) .. (8.2,1.83) ;     \draw[dashed,sloped] (8.2,-1.83) .. controls (7.7,0) .. (8.2,1.83) ;          \draw[sloped] (9,0) .. controls (11.04,1.96) .. (14.59,0) ;     \draw[sloped,dashed] (9,0) .. controls (11.04,-1.96) .. (14.59,0) ;     \draw[dashed,sloped] (11.04,-1.5) .. controls (10.5,0) .. (11.04,1.5) ;     \draw[dashed,sloped] (11.04,-1.5) .. controls (11.5,0) .. (11.04,1.5) ;          \draw (15.79,0) -- (17.5,1.93) -- (22,0) -- cycle;     \draw[dashed] (15.79,0) -- (17.5,-1.93) -- (22,0) -- cycle;     \draw[dashed,sloped] (17.5,-1.93) .. controls (16.8,0) .. (17.5,1.93) ;     \draw[dashed,sloped] (17.5,-1.93) .. controls (18.1,0) .. (17.5,1.93) ;     \end{tikzpicture}          \end{document}


title: MonTeX and XeLaTeX fonts

text: This is my second question regarding MonTeX, a follow up to this one, which concerned a conflict between `xelatex` and `MonTeX` Since writing that question I contacted and received help from the author of the package, who managed to enable some of the commands offered by the `MonTeX` package by using this patch:               \usepackage{rotating}     \font\bithehfont=bthhsm     \font\bithevfont=bthvsm     \newif\ifRtoL     \RtoLfalse     \newcommand{\bithe}[1]{%         {\ifRtoL\bithevfont\else\bithehfont\fi#1}}%     \newcommand{\mabosoo}[1]{\bosoo{\bithehfont#1}}%     \newcommand{\bosoo}[1]{%         \raisebox{1.25ex}{%         \begin{turn}{270}%             #1%         \end{turn}}%     }%      I would need to enable some other commands offered by the package as well, notably the commands for horizontal and vertical Classical Mongolian and the smaller font sizes for both Manchu and Mongolian. The author of the package appears to be unavailable. On this forum someone states to have developed an alternative package for typesetting Mongolian, but the package is not available for download and the user appears to be inactive and cannot be contacted. So my question is, could anyone help me to enable the following commands for use together with `xelatex` (in the "Simplified Transliteration Mode" for Mongolian): `\bicig` `\bithe` `\mobosoo` `\mabosoo` (In both the `sffamily` [for Mongolian] and `rmfamily` [for Manchu] fonts) Furthermore, the patch above will only enable writing Manchu in a fairly large font, too large to pair with 12pt text in Latin script. Is there a way to enable smaller type for the Manchu/Mongol commands as well? That is certainly a lot of questions. If I haven't been clear, please let me know. Thanks a lot. **UPDATE:** Here is a complete minimal (non-)working example:               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Linux Libertine O}     %\usepackage{mls} %Not loading MonTeX since the patch below defines the command     \usepackage{rotating}     \font\bithehfont=bthhsm     \font\bithevfont=bthvsm     \newif\ifRtoL     \RtoLfalse     \newcommand{\bithe}[1]{%         {\ifRtoL\bithevfont\else\bithehfont\fi#1}}%     \newcommand{\mabosoo}[1]{\bosoo{\bithehfont#1}}%     \newcommand{\bosoo}[1]{%         \raisebox{1.25ex}{%         \begin{turn}{270}%             #1%         \end{turn}}%     }%     \begin{document}     \bithe{manju gisun}\\ %Typing Manchu     yǐ mǎn zhōng wèn wén\\     \emph{yǐ mǎn zhōng wèn wén}     \end{document}      ![enter image description here](http://i.stack.imgur.com/WCUix.png) The outcome with the command `\bithe` works as intended, except for the fact that the font size is too big. Since `\bicig` is not defined, the command `\bicig{bagadur}` naturally gives an error message.


title: How to produce John Kruschke's Bayesian model diagrams using TikZ or similar tools?

text: In a May 2012 blogpost John Kruschke discusses how he prefers his diagram conventions for representing bayesian models to the traditional approach. You can see an example of his approach in the diagram below: ![John Kruschke Model Diagram](http://i.stack.imgur.com/6XH6h.jpg) Several people commented that they would like to adopt the convention if there was some way of automating the creation of such plots. I currently have minimal experience with the various TeX related drawing tools like TikZ. **1. Would TikZ be a suitable tool for producing such diagrams? Or would another tool be more suited?** Also, such models are often adapted over time. Thus, automating or semi- automating the drawing process would be desirable. **2. To what extent could TikZ or a similar tool facilitate the automation or reuse of drawing such plots?** Finally, I'd be interested in any existing examples of something similar. **3. Thus, are there any examples of TikZ code doing something similar? Or if anyone was willing to show template code for something similar, that would be most appreciated.**


title: author year with natbib package

text: I use the natbib package, and my bibliography style is acm (small caps). I would like to have 'year' appearing right after the author name, but I get this error message: > ! Package natbib Error: Bibliography not compatible with author-year > citations. I have checked that all the entries in my .bib file have a year. In addition, I made sure my .bib file is encoded in UTF-8, supported by natbib. Any suggestions?               \documentclass[12pt,a4paper]{article}     \usepackage[english]{babel}     \usepackage[numbers,authoryear]{natbib}     \begin{document}     blablabla     \nocite{*}     \bibliographystyle{acm}     \bibliography{FinalVersion}     \end{document}


title: Update a package after TeX live freeze?

text: I realized that I want/have to update a package (`moderncv`). The problem is that TeX Live went frozen – so there are no more updates. Is the only thing to do is wait till the release of the next TeX Live? Is there some way to hack my TeX Live (2012) installation, and once the next version is out revert to the newer release?


title: Automatic line breaking for two-column text

text: I am using the following document class:               \documentclass[twocolumn]{svjour3}      Unfortunately, the two columns of output text just look horrible as they are not properly aligned on the right-hand side of the text. I am just wondering whether I can automatically tell LaTeX to align it nicely on the right-hand side or if I have to manually tell LaTeX when to break a line as this is sometimes not happening.


title: Any way to center text within a \parbox?

text: Probably I'm missing something, but I'm really struggling to find an answer to this simple question: How to center text within a `\parbox`? Side note: I don't want to switch to any other environment like `minipage`. In particular, I use `\pbox`, an auto-sizing version of `\parbox`. There don't seem to be an analogue for `minipage`. * * * Ok, so `\centering` as presented in one of the posts is working for the given simple example. I'm however somehow unable to adapt it to my concrete case that is:               \usepackage{pbox}     \usepackage{bussproofs}     ...          \pbox{1\textwidth}{       \AxiomC{$ Rule premise $}       \UnaryInfC{$ Rule conclusion $}       \DisplayProof (Rule name) \\       Some text here in new line     }      * * * It seems `\pbox` indeed works differently with respect to `\centering` than `\parbox`. In particular this works:               \usepackage{bussproofs}     ...          \parbox{1\textwidth}{\centering       \AxiomC{$ Rule premise $}       \UnaryInfC{$ Rule conclusion $}       \DisplayProof (Rule name) \\       Some text here in new line     }      I'll probably have to use the original `\parbox` after all or perhaps switch to a `varwidth`. * * * I thank you all for your help. I think I'll be able to solve my issue somehow using a combination of the ideas that you presented.


title: How to detect if in an exercise environment?

text: I found in How to use figure inside a exercise environment? that I can't use begin{figure} ... \end{figure} in an exercise environment. I also found situations where avoiding the use of such floats can cause other trouble (see: In memoir environment, the chapter heading placement gets messed up if a too big figure gets placed on next page). The logical thing to do would be to have a programatically check for an Exercise or Answer environment, perhaps doing something like the following:               \newcommand{\imageFigure}[4]{%       IF I AM IN A FLOAT-UNSUPPORTED environment % ie: Answer or Exercise         \begin{center}%            \captionsetup{type=figure}%            \includegraphics[totalheight=#4\textheight]{#1}%            \caption{#2}%            \label{#3}%         \end{center}%       ELSE         \begin{figure}[htp]%            \centering%            \includegraphics[totalheight=#4\textheight]{#1}%            \caption{#2}%            \label{#3}%         \end{figure}%       ENDIF     }      The question How can I detect if I'm inside or outside of a float environment? does something similar, and using that idea I thought I might be able to use the \theExercise and \theAnswer counters, but it appears that their values can be non-zero even when not in these environments. I imagine that it would be possible to set and clear a flag before and after using either of these environments respectively. Perhaps there is already such a flag already internally in the exercise.sty implementation. Presuming this is possible, how would the pseudocode predication in the figure generation command above be modified to actually work?


title: Create a lorenz curve

text: For my first real document, I have to create lorenz curves. Problem is, I'm pretty new to TeX and I have absolutely no clue about how I should go about this. A google search only reveals this has not been attempted by anyone else, so any help or pointers are welcome.


title: Custom bibliography style (natbib like) with biblatex

text: I have just switched from natbib to biblatex, and I am trying to restore some of the previous layouts. I have this import now:               \usepackage[natbib=true,style=verbose-ibid,isbn=false]{biblatex}      which gives me the citation style I want. However, for journals the bibliography style changed in an unfortunate way. Before it looked like this: > Charles, D. (1965), ‘Entr’acte: “Formal” or “Informal” Music?’, _The Musical > Quarterly_ **51** (1), 144–165. Now it looks like this (I managed to get rid of the "In:"): > Charles, Daniel. “Entr’acte: “Formal” or “Informal” Music?”, _The Musical > Quarterly_ 51.1, pp. 144–165. I would like to keep a few things from the new style, like full first name, but otherwise revert to the natbib style, with date in the front, title in single inverted commas, volume in bold and number parantheses. Like this: > Charles, Daniel (1965), ‘Entr’acte: “Formal” or “Informal” Music?’, _The > Musical Quarterly_ **51** (1), pp. 144–165. How would I achieve this? * * * **EDIT** I managed to get the year in the beginning by using diverging citation and bibliography styles:               \usepackage[natbib=true,citestyle=verbose-ibid,isbn=false,bibstyle=authoryear]{biblatex}      I followed the answer to this question. I can use               \DeclareFieldFormat[article]{volume}{\textbf{#1}}     \DeclareFieldFormat[article]{number}{(#1)}      to make the volume bold and put the number in parentheses. But several macros don't exist here. I had to use `\textbf` instead of `\mkbibbold` (unknown macro). Moreover, I can't disappear the point between volume and number, now it's > Charles, Daniel (1965), “Entr’acte: “Formal” or “Informal” Music?” _The > Musical Quarterly_ **51**.(1), pp. 144–165. If I try               \renewbibmacro*{volume+number+eid}{%       \setunit*{\addcomma\space}% NEW       \printfield{volume}%     %  \setunit*{\adddot}% DELETED       \setunit*{\addcomma\space}% NEW       \printfield{number}%       \setunit{\addcomma\space}%       \printfield{eid}}      I get this error:               LaTeX error: \abx@macro@cite:labelyear+extrayear undefined.


title: Label Points in a circle in tikz

text: Consider the slight modification of the construction from the solution to this question: Variables and basic arithmetics and tikz-euclide               \documentclass{minimal}     \usepackage{tkz-euclide}     \begin{document}          \begin{tikzpicture}[scale=3]     \tkzDefPoint(0,0){O}     \tkzDrawCircle[R](O,1 cm)     \def\sectors{20}     \foreach \i in {1,2,...,\sectors} {         \tkzDefPoint({\i*360/\sectors}:1){P\i}            \tkzDrawSegment[color=black](O,P\i)         \tkzLabelPoint(P\i){\i} %modified here!     }     \end{tikzpicture}     \end{document}      This gives me the following output: ![enter image description here](http://i.stack.imgur.com/Vl5YS.jpg) Now my question is, if it is possible to position the labels in extension of the radial lines. Is it possible to rotate the labels additionally corresponding to the orientation of the respective radial line? (so that for example the 5 on my output would be rotated by 90° counter-clockwise).


title: Clash between knitr, tikzDevice and pgfplotstable

text: I use `knitr` to compile a document composed of two `.Rnw`. Please considered the following examples from this answer `main.Rnw`               % !Rnw weave = knitr     % !TeX program = pdfLaTeX          \documentclass[final,12pt]{article}          \usepackage[a4paper]{geometry}     % \usepackage{pgfplotstable}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}          <<include=FALSE>>=       opts_chunk$set(concordance=TRUE, fig.width='8', fig.height='4', fig.pos='htb', out.width='\\textwidth')     @          \begin{document}     <<child-demo, child='include.Rnw', eval=TRUE>>=     @     \end{document}      and `include.Rnw`               % !TeX root = main.Rnw     % !Rnw weave = knitr     % !TeX program = pdfLaTeX          Let's plot the spectrum of $Na$:          <<'na', dev='tikz', fig.cap='Spectrum of $Na$', echo=FALSE>>=       plot(c(1:10))     @      I have noticed that uncommenting the line `\usepackage{pgfplotstable}` the pdf produced by the `tikzDevice` is of size 0. This is the verbose output of the `R` console while knitting when loading the `pgfplotstable`, as you can see there's no error message, still the `.pdf` file (but not the `.tikz`) produce is of size 0.               > > options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE)     > .ess_weave(knit, "/my/path/main.Rnw")     Loading required package: knitr               processing file: /my/path/main.Rnw       |.............                                                    |  20%       ordinary text without R code            |..........................                                       |  40%     label: unnamed-chunk-1 (with options)      List of 1      $ include: logi FALSE            |.......................................                          |  60%       ordinary text without R code            |....................................................             |  80%     label: child-demo (with options)      List of 2      $ child: chr "include.Rnw"      $ eval : logi TRUE                    processing file: /my/path/include.Rnw       |......................                                           |  33%       ordinary text without R code            |...........................................                      |  67%     label: na (with options)      List of 3      $ dev    : chr "tikz"      $ fig.cap: chr "Spectrum of $Na$"      $ echo   : logi FALSE          Warning: 'mode(width)' and 'mode(height)' differ between new and previous          ==> NOT changing 'width' & 'height'     Creating new TikZ metrics dictionary in:         include-tikzDictionary       |.................................................................| 100%       ordinary text without R code                 |.................................................................| 100%       ordinary text without R code               output file: main.tex          [1] "main.tex"      And here the last part (too long to post all) of `na.log` from generating the picture (in the rest of the document I couldn't find any error):               Package pgfplots Warning: running in backwards compatibility mode (unsuitable t     ick labels; missing features). Consider writing \pgfplotsset{compat=1.9} into y     our preamble.      on input line 33.               Overfull \hbox (99.38345pt too wide) in paragraph at lines 124--125     [][]       []          (./na.aux) )      Here is how much of TeX's memory you used:      20223 strings out of 493311      479203 string characters out of 6137849      631627 words of memory out of 5000000      23277 multiletter control sequences out of 15000+600000      4702 words of font info for 16 fonts, out of 8000000 for 9000      957 hyphenation exceptions out of 8191      65i,7n,84p,700b,609s stack positions out of 5000i,500n,10000p,200000b,80000s          No pages of output.     PDF statistics:      3 PDF objects out of 1000 (max. 8388607)      3 compressed objects within 1 object stream      0 named destinations out of 1000 (max. 500000)      13 words of extra memory for PDF output out of 10000 (max. 10000000)      Is it possible to use `pgfplotstable` along with the `tikzDevice`?


title: 3D statistical figures

text: I wonder which software (e.g. MetaPost, TikZ, etc.) is best to use to reproduce the figure pasted below. The example is taken from new data mining book (p. 205). ![enter image description here](http://i.stack.imgur.com/brXT5.png)


title: Beamerposter not showing correct fonts in math mode

text: I am making a poster using `beamer` package and I have problems in mathematical symbols like summation and fractions. My preamble file has following               \documentclass[final]{beamer}      \usepackage[scale=1.24]{beamerposter}       \usetheme{confposter}       \usepackage{graphicx}      \usepackage{booktabs}      \usepackage{mathtools}      \usepackage{amsmath}      These equations give me problems               \begin{equation}     V(\phi) =  \sum\limits_{m=1}^{n} \left(\sfrac {1}{2} V_m ( 1 - \cos k \phi) \right)      \end{equation}           \begin{equation}      \frac{\mathrm d^2}{\mathrm d^2 x} \left( V(\phi) \right) = \sum\limits_{m=1}^{n}     \left(\sfrac {1}{2} V_m^2 ( \cos k \phi) \right)      \end{equation}       For instance I need large summation and small fractions. but I am not getting it right. What I am actually using is the template given in this link, since I am new to LATEX. http://www.latextemplates.com/template/jacobs-landscape-poster You can put this modified equations to this templates to test that. If you need my code I can provide but still based on this template.


title: Split paragraphs into table rows

text: I am writing a class file. I am defining a variable for my custom `\maketitle` like so:               \newcommand*{\comment}[1]{\def\commentname{#1}}     \comment{}      I want to be able to write a list of comments like so:               \comment{         Comment1: this is a comment.              Comment2: this is also a comment.              etc.     }      Then I would like my `\maketitle` to form a table with each of the comments in a separate row. The table should preferably have a dynamic number of rows so that added comments increase the size of the table. Is this possible?!


title: with pgfplots gives an error when I restrict the range but not when I have an unrestricted range

text: The following example compiles fine for me:               \documentclass{article}     \usepackage{pgfplots}     \begin{document}          \begin{tikzpicture}         \begin{axis}[axis lines=middle,                      %%ymax=10,                      ymin=-7,                      ]            \addplot [domain=-2:-1.001,   samples=25]  {(\x-1)/(\x^2-1)};            \addplot [domain=-0.999:0.999,samples=20]  {(\x-1)/(\x^2-1)};            \addplot [domain=1.001:2,     samples=25]  {(\x-1)/(\x^2-1)};         \end{axis}     \end{tikzpicture}          \end{document}      But when I uncomment the line `ymax=10`, I get the following error:               ! Dimension too large.     <recently read> \pgf@yy           l.14     \end{axis}          ?       What's happening here? I would like not to have to restrict the domains.


title: "itemize" or "enumerate" IN section headings

text: Is it possible to use lists WITHIN section headings, subsection headings, etc.? I wanted to do so like               \documentclass[11pt]{scrartcl}     \usepackage{enumerate}     %...     \begin{document}          \section{My three favorite flowers are:      \begin{enumerate}       \item Roses       \item Daysies       \item Violets      \end{enumerate}     Now I will tell you stuff about them}          \end{document}      but it doesn't compile. Error is:               Argument of \@sect has an extra }.     <inserted text>                      \par


title: Grabbing data from website and use it in LaTeX document

text: This is a follow-up question to "Line breaking and alignment in list".               \documentclass[       a4paper,       12pt     ]{article}          \usepackage[       hmargin=2.4cm,       vmargin=3cm     ]{geometry}     \usepackage{amssymb}     \usepackage{enumitem} % better to use enumitem     \usepackage{totcount}     \usepackage[       colorlinks=true,       urlcolor=black     ]{hyperref}          \newcommand*\film[4]{%      \item[\refstepcounter{enumi}\textcolor{blue}{$\maltese$} \textsf{[#4]}] \textsf{\href{#1}{#2}~(#3)}}            \regtotcounter{enumi}          \begin{document}          \begin{enumerate}[leftmargin=5em,labelindent=-5em]       \film{http://www.imdb.com/title/tt0134273/}{8MM}{1999}{6,4}       \film{http://www.imdb.com/title/tt0050083/}{12 Angry Men}{1957}{8,9}       \film{http://www.imdb.com/title/tt0057181/}{Incredibly Strange Creatures Who Stopped Living and Became Mixed-Up Zombies, The}{2006}{2,1}     \end{enumerate}          I have \total{enumi}~films.          \end{document}      Now that David has helped me getting the vertical alignment in order, I would like to make the document more automatic: It is possible to grab the film rating from the IMDB site and insert it in the document as the last argument in the `\film` command? Can I somehow automatically get, e.g., "6.4" from http://www.imdb.com/title/tt0134273/ and insert it in the document? The point is that the rating changes over time and then I don't have to update the entries manually for each film.


title: BibLaTeX bibliography without square brackets

text: My current BibLaTeX bibliography output looks like this: [1] Bob et al. “How to Make Cheese”. In: Farming 101 (2010). [2] Cohen. “The Varities of Cheeese" In: International Journal of Cheese (2003). [3] Cox et al. “Cheese: A Comparative Guide”. In: Cheese Aficionados (2002). (The single line bibliography was achieved using this answer.) I would like the bibliography to look like this: **1.** Bob et al. “How to Make Cheese”. In: Farming 101 (2010). **2.** Cohen. “The Varities of Cheeese" In: International Journal of Cheese (2003). **3.** Cox et al. “Cheese: A Comparative Guide”. In: Cheese Aficionados (2002). But I am not sure how to bold the numbers. Any help would be appreciated.


title: Set 1,5 line spacing in footnotes

text: The document I have to write needs to have a 1,5 line spacing both in normal text and in footnotes. Now, if I use this code:               \documentclass[11pt, a4paper, oneside]{book}     \usepackage{setspace}     \usepackage[hang]{footmisc}     \usepackage{lipsum}          \setlength{\footnotemargin}{2mm}          \begin{document}     \begin{spacing}{1.5}          \lipsum*[1]\footnote{\lipsum[1]}          \end{spacing}     \end{document}      what I get is this: ![](http://i.stack.imgur.com/Hqo5O.png) As you see the footnote ignores the spacing of the rest of the document. If I try to space the footnote this way instead:                   \documentclass[11pt, a4paper, oneside]{book}     \usepackage{setspace}     \usepackage[hang]{footmisc}     \usepackage{lipsum}          \setlength{\footnotemargin}{2mm}          \begin{document}     \begin{spacing}{1.5}          \lipsum*[1]\footnote{\begin{spacing}{1.5}\lipsum[1]\end{spacing}}          \end{spacing}     \end{document}      what I get is this: ![](http://i.stack.imgur.com/iMW3w.png) In this case the footnote actually _is_ spaced correctly, but the note's number is put in a separate line. What I suspect is happening here is that, by trying to format the footnote this way, the number isn't formatted as the rest of the text, and is then considered to be a different paragraph. So what I get is a footnote divided into two paragraphs, one of them including only the one and not-having the 1,5 spacing, and the second one containing the actual text and having the 1,5 spacing. Of course I'd like the note number to be with the rest of the note. Someone here knows a way to do such thing?


title: LaTeX mark-up as a generic mark-up language

text: Tremendous benefits can accrue, if TeX-like mark-up could be used in lieu of html and its variants, where a requirement exists to have a document both as (All)TeX mark-up and html format. There are benefits both ways. For (All)TeX a browser interface is unquestionably the best means of providing a flexible and user friendly User Interface and requiring minimal programming. One could program settings to be captured via interactive screens to manage packages and variable settings. On last count a complicated document might need over 700 variable settings, and although most of us solve the problem with class selection the difficulties remain. Another benefit is the organization of the document data and managing files and directories through a visual interface, rather than a console and lastly and perhaps one of the most important consideration is the possibility of using server and scripting languages for calculations and access to web documents and databases, where (All)TeX is limited. For `html` a macro language could be used to generate complicated html patterns such as code-blocks, complicated visual displays of images (that require a lot of `divs`) and similar. Additionally, if the mark-up was in (All)TeX, documents could be generated on the fly. Here is the question, before I give a bit more background to satisfy the rules and to keep the closure squad happy. **What are your views? Is TeX-like mark-up a good way of structuring documents? I personally think the answer is yes with the exception of tables. What would be a suitable mark-up for tables?** Some more background. I have a personal CMS build with CodeIgniter that I use to keep a lot of documents and personal notes, especially on programming. ![enter image description here](http://i.stack.imgur.com/bOupH.jpg) Any code in code-blocks can be run interactively and see the results within the browser. I have code for quite a few languages, such as javascript, lua, php, haskell, perl etc. Mark-up was originally based on using hard-coded html, markdown and wiki-style mark-up. I have now added a filter where it parses LaTeX code and produces the relevant `html` with simple environments, such as `\begin{jscodeblock}..\end{jscodeblock}`. I have also added code for most common `LaTeX` commands and a few for images. ![enter image description here](http://i.stack.imgur.com/sQ7yZ.jpg) Pressing the "texify" button sends the document through a filter that parses any markdown and wiki-like tags and produces the pdf, which can be viewed directly in the browser. ![enter image description here](http://i.stack.imgur.com/Il34l.jpg) A major advantage for me, and possibly for anyone used to breaking up long documents in different files, is that the system can be used within the browser to "collate" all the files and produce the full document `pdf`. The menu on the left represents all the individual files and a `main` file is used, if the full document is required, otherwise it only prints the page. An automated 'menuing' system helps with the nightmare of managing hundreds of files. (On the left in first image). ![enter image description here](http://i.stack.imgur.com/hOvQu.jpg) I have been using, markdown and its variants and I am familiar with `pandoc` and `LaTeX2html` packages. They all have their limitations and usages. So far marking through LaTeX only commands have improved my workflow and productivity. I have managed to provide filters for most macros to display well in browsers - except tables. There is no problem parsing and translating simple table mark-up such as the one provided by mark-down, however anything more complicated and parsing is next to impossible. **I believe that the answer may lie in redefining the way we mark tables in LaTeX and I invite your ideas.** Maths mark-up, was solved with MathJax and a small filter. There is much more in the system that I can describe in a question, such as managing settings, cover-images, styles and the like. As we lack an `experimental` tag, I have tagged the post as `mark-up`. **Edit:** Similar idea in practice authorea give it spin.


title: Colorbox inside Multicols

text: So I am using the `multicols` environment and I want to have the background of some portions of the column colored. However, I see that `multicols` does not play well with `xcolor` and colored sentences overflow in the next column. Why is that happening? Would `tcolorbox` work better in this case? Example:               \documentclass[10pt,landscape, fleqn]{article}     \usepackage{multicol}     \usepackage{calc}     \usepackage{ifthen}     \usepackage[landscape]{geometry}     \usepackage{amsmath,amsthm,amsfonts,amssymb}     \usepackage[usenames,dvipsnames]{xcolor}     \usepackage{graphicx,overpic}     \usepackage{hyperref}     \usepackage{listings}          %problem statement                                                                                \newcommand{\problem}[1] {       \rule{1\linewidth}{0.25pt}\\        \colorbox{yellow}{#1}     }          % -----------------------------------------------------------------------                                                                                \begin{document}     \raggedright     \footnotesize     \begin{multicols*}{3}               \setlength{\premulticols}{1pt}     \setlength{\postmulticols}{1pt}     \setlength{\multicolsep}{1pt}     \setlength{\columnsep}{2pt}          \problem{This is a long sentence that will unfortunately cross the multicols boundaries.}          This is a long sentence that will not cross the multicols boundaries.               \end{multicols*}     \end{document}


title: prooftree from bussproofs package inside "cases" environment

text: I am using `bussproofs` package to provide some type proofs. According to `bussproofs` manual, it is impossible to use `prooftree` inside math mode. However, I would like to insert `prooftree` in the `cases` environment. If there are any tricks I can do to overcome this? The minimal working example:               \documentclass{article}     \usepackage{amssymb,amsmath}     \usepackage{bussproofs}     \begin{document}         \[\epsilon=         \begin{cases}             \AxiomC{$\alpha$}             \UnaryInfC{$\beta$}             \DisplayProof             %\begin{prooftree}                 %\AxiomC{$\alpha$}                 %\AxiomC{$\beta$}                 %\BinaryInfC{$\gamma$}             %\end{prooftree}         \end{cases}\]     \end{document}      I want the commented section to compile as well.