title: newgeometry makes content run to next page

text: Thank you all from the beginning for your help in this. I'm completely new to LaTeX as I'm writing my bachelor thesis, so I'm sure I've made lots of mistakes... I'm using the `geometry` package because I need to modify the text width at a certain point in my thesis, and to do so I wanted to use `\newgeometry` inside a custom environment. The problem is that the part of the text that should be influenced by the new geometry runs all the way down to the next page. I have read this Using \restoregeometry in environment, next page runs off the page bottom question and, as you can see, I also used the `\aftergroup` comman, but still the issue persists. My custom environment is:               \newenvironment{esempio}[1]%     {         \vspace{1.5ex}         \noindent         \underline{#1}         \nopagebreak         \newgeometry{textwidth=\textwidth}         %\leftskip=1cm         %\rightskip\leftskip     }     {         \par         \aftergroup\restoregeometry     }      And i use it like:               \begin{esempio}{$k=2$}         Il Poligono di Controllo \`e formato da $\{P_0, P_1, P_2\}$.         La curva di Bezier \`e definita come $$P_0^2(t) = (1-t)P_0^1(t) + tP_1^1(t)$$     \end{esempio}      I get the " K=2 " underlined in the correct position, but the following text is all down to the next page. My aim would be to have an environment that lets me format a body of text like this:               bla bla bla bla bla bla bla bla bla bla bla bla     K=2        bla bla bla bla bla bla bla bla        bla bla bla bla bla bla bla bla      As a sidenote, you can see I also tried with the `\leftskip`. It gets the job done very well with the normal text, but most of the times I'll also include a picture on the side and I want the text to wrap around it, and with the `\leftskip` it leaves the space on the left of the image and so the text does not wrap nicely. * * * @ egreg: thank you for the warm welcome and the tips :) @ Gonzalo: thanks, your code works like a charm for the text! However, as i said in the original question, a very common situation would be to insert a figure inside that text and i'd like the text to be wrapped around the picture. However, this causes a couple of warnings and bad boxes in the compilation process and the figure gets moved down and placed not after the "esempio" box, but after even the next paragraph, and it also creates huge blank spaces... quite weird. Below the MWE (rettaBezier is a picture 4cmx4cm square)               \documentclass[a4paper,11pt,italian]{book}          \usepackage[italian]{babel}     \usepackage{graphicx, wrapfig, subfig}     \usepackage{changepage}     \usepackage{calc}     \usepackage{amsmath, amsthm, amssymb, mathrsfs, setspace}     \usepackage{mycommands}     \usepackage{indentfirst}     \usepackage[format=hang,font=footnotesize,labelfont=bf]{caption}     \graphicspath{{./images/}{./matlab/}}     \usepackage{lipsum}                         \begin{document}     \lipsum[2]     \begin{esempio}{$k=1$}         \begin{wrapfigure}{o}[1cm]{0cm}             \centering             \includegraphics{rettaBezier}             \caption{Retta ottenuta con $P_0 = [0, 0] , P_1 = [1, 1]$}             \label{rettaBezier}         \end{wrapfigure}         \lipsum[2]     \end{esempio}          \lipsum[2]               \end{document}


title: How to configure TexStudio editor to use Xindy?

text: I am using TexStudio editor for LaTeXing, I want to use Xindy engine though for indexing, in the commands of TexStudio, I found there is a default command for `texdindy` as in the image below. But how to use xindy then? Do I have to use `xindy` explicitly in texstudio or `texindy` will do the job? is there any possibility also to assign a dedicated key for using `xindy` and how to generate an index with that?   I hope the answer would contain a MWE showing the goodies of xindy by using TexStudio editor, with some explanation of how to make sure that `xindy`, and not other default engines like `makeindex`, is doing the sorting and collating job. **Notes:**   * I am using TexStudio 2.5.2 version    * xindy does not come with MikTeX distribution, you have to install it manually, here is a post for that, although I didn't make it myself, that's why I installed TexLive distribution instead, xindy ships already, and you don't need to install perl separately if you are using windows, or even bother yourself with any other stuff.  ![enter image description here](http://i.stack.imgur.com/uOiaT.png)


title: How can I tell LyX to differentiate between left Alt and right Alt (AltGr / 3rd Level)

text: To increase my productivity, I would like so simplify some of the existing keyboard shortcuts (in particular Greek letters), by using either Left Alt or Right Alt in a non-interchangeable manner, i.e. so that LyX would perform a different action for `[Left Alt + F]` (open the file menu) and for `[Right Alt + F]` (insert the letter phi, for example). Currently (on version 2.0.6), each of the keys is interpreted as the same `[Alt]`.


title: Einstein summation convention

text: In Einstein's summation convention, it is sometimes necessary to have subscript and superscript indices in a certain order. If you just use `^` and `_`, these indices would appear on top of one another, e.g. `\Lambda^\mu_\nu`. To escape this, you can type               \Lambda^\mu{}_\nu      Couldn't find this on the web, so I figured I'd post it myself.


title: Custom pagebreak in align equation

text: I got the following problem: Right now I am checking my equations, which are usually written in `align`. This looks great in most of the cases, but sometimes the pagebreaks are weird, ie there is a lot of vertical whitespace left (like 2.5cm) at the end of a page. I made the following MWE to illustrate this.               \documentclass[a4paper, 12pt, headsepline]{scrreprt}     \usepackage[onehalfspacing]{setspace}     \usepackage{amsmath, amssymb, mathtools}     \usepackage{mathptmx}     \usepackage[a4paper]{geometry}     \geometry{left=2cm,right=5cm,top=2cm,bottom=2cm}     % \usepackage{lipsum} %\lipsum     \usepackage[pangram]{blindtext}          \begin{document}     \Blindtext[1][3]%1 paragraph, 3 pangrams     \begin{align}     X_{t+1} &=  \frac{X_{t+1}+X_{t+1}}{Y_t}  \label{eq:1}      \intertext{Solving...:} \notag      X_{t}  &=  \frac{X_{t+1}+X_{t+1}}{Y_{t+1}} \notag \\     \intertext{Solving further...:} \notag      % ===PAGEBREAK HERE: 2nd page begins===     &= \frac{X_{t+1}+X_{t+1}}{Y_t} +      \frac{X_{t+1}+X_{t+1}}{Y_t}  \notag \\     &= \frac{X_{t+1}+X_{t+1}}{Y_t}...  \notag \\     \intertext{Solving further...:} & = \frac{X_{t+1}+X_{t+1}}{Y_t}  \notag     \end{align}      \end{document}      In the MWE, the first 'Solving further' should be on the first page instead (to save space and it would also look better I guess?). The position where I would like the pagebreak to be is also marked as a comment in the MWE. My question is first on a general basis: Which is the best environment to achieve multiple line equations, which can be aligned as in `align`, and to save space at the same time? Or to be more precise: If possible, I'd like to stick with `align` and adapt the pagebreaks only if necessary. Thanks!


title: How to make a two-column table with border?

text: I have never been able to figure out how to make tables do what I want in LaTeX. How do I make a two-column table with a border and a line down the middle separating the two columns?


title: Adding Imprint Shadow font

text: I'm using MiKTeX on Windows, and I've found Imprint Shadow font which I'd like to use with lettrine for capitalization of first font of chapters (I'm experimenting a bit). I've extracted all the necessary files from here. I also have the .pbf font in place. Now I don't understand the next step I've found in the instructions:               3.  Add +miih.map to the configuration files of dvips, pdftex and your         dvi previewer.          4.  Run texhash and updmap programs to update the conguration files and file names database      Where do I need to do this? :\ Do I need to just update formats and file names database in MiKTeX options? EDIT: And even tho I've added everything as instructed (I unzipped everything in its right place) I cannot get the font to work :| Any help on this?


title: How do I customize the biblatex entries in Texmaker's bibliography menu?

text: I use Texmaker on Linux and am very happy with it. I would like to customize the Biblatex entries in the Bibliography menu, though. They don't include a lot of fields that I need, which somewhat defeats the purpose of having the menu in the first place, since I end up manually entering the missing fields. Example: the article entry looks like this:               @article{•,     author = {•},     title = {•},     journaltitle = {•},     year = {•},     }      volume, number, pages and date are all missing. For Bibtex, these are included as OPT fields that can be removed with "clean" command from the Bibtex submenu. I figure there has to be an easy way to customize this. I tried searching the xml config files, but didn't find anything but the settings that can already be configured through Texmaker's menus and settings tools.


title: Beamer "box" too big when I add more subsubsections

text: I am preparint a presentation in beamer using the theme "beamerthemeshadow". In all slides, next to the superior border, a list appears always with section and subsection name, highlighted depending on the part of the presentation I am. It worked fine, but I observe now, in some part I added 5 subsubsections, and now the "box" (what is the right name for this?) grew a lot, so now it takes half slide! I do not udnerstand this since subsubsections do not appear on this object. Can you tell me how do I solve this? Thanks P.D. And how can one shorten the name of the subsections and sections as they appear on this "box"?


title: Using the "use a build subdirectory for output files' option in TeXMaker in combination with LuaLaTeX

text: I want to use LuaLaTeX since I have some quite large .tikz files, but when I do so TeXMaker does not put the output files in the 'build' directory like it would do if I use PdfLaTeX. I find the build directory very convienent to keep things organized. Anybody any idea how I can fix this?


title: What is the name of the default font in math mode?

text: I draw figures in Inkscape. When I label elements within the figures with variable names that I have used in the underlying TeX document, I would like them to look exactly the same as in the document. (e.g. l does not look the same as $l$) What is the name of the math mode font so I can select it correctly in the Inkscape font list? If the exact font should not be available, what is a similar looking font that is present on most systems?


title: Is nag.sty authoritative for LaTeX?

text: I just (re?)discovered `nag.sty`. is this a (TUG-endorsed?) authoritative tool to get all of us away from non-recommended use of latex, or just the work of the author? given that latex never seems to deprecate packages, voluntary standards may be a way forward. (I love tools that tighten up the syntax of latex documents, especially if they could help me maintain externally- parseable documents.)


title: Incorporate asymptote environment into macro

text: I'm trying to write a macro (ideally an environment, but a command would do) that takes a piece of Asymptote code, displays it in a `verbatim` environment, and then runs it through an `asy` environment. Unfortunately, my every attempt at the latter seems to go wrong. Here's a MWE:               \documentclass{article}     \usepackage{asymptote}     \newcommand{\asycode}[1]{\begin{asy}     #1     \end{asy}}     \begin{document}     \asycode{label("$x^2 = x \cdot x$");}     \end{document}      If I attempt to compile this, I get the following:               Runaway argument?     ! File ended while scanning use of \next.     <inserted text>                      \par      <*> problem.tex          ?       What am I doing wrong here, and can it be fixed in any remotely reasonable fashion? [Note: I've tried a number of different permutations regarding line break placement, etc., and none of them seem to work.]


title: How can I number sections below subsection in LaTeX?

text: I want to make sections in LaTeX. For a document with `chapter` divisions, one has   * 1.1 = section   * 1.1.1 = subsection   * 1.1.1.1 = subsubsection What about 1.1.1.1.1? What do I have to use to make lower-level sections be numbered as 1.1.1.1.1?


title: Problem with language, book class, and Table of Contents

text: I have this simple piece of code here:               \documentclass[11pt]{book}     \begin{document}     \tableofcontents     \clearpage     \section{Dummy section 1}     \section{Dummy section 2}     \end{document}      And every time I add `\usepackage[greek]{babel}` I get the following errors at the compiler:               ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\babel\lgrcmr.fd")TFM file     C:\Users\stamatis\AppData\Local\MiKTeX\2.9\fonts/tfm/public/cbgreek \grxn2488.tfm     already exists.     pdflatex.EXE: The font file could not be found.     pdflatex.EXE: Data: grxn2488     texify: pdflatex failed for some reason (see log file).      Note that without the language change I get the desired results. Do you have any idea on how to correct this?


title: Texmaker 4.0.3 internal viewer jumps to front page when pressing view PDF

text: When I press the view PDF the internal viewer always jumps to the front page, with a red square indicating that I have made a change to the headline, but I have made no change. (Sometimes the red square is some random place on the front page) Is there a way to make the internal viewer open the page which I have just viewed, I is verry frustrating that I have to scroll down to page 50 each time I press the view PDF. My Frontpage looks like this: (I dont se any problem)               \begin{document}     \lstloadlanguages{Matlab}     \begin{titlepage}            \begin{center}                 {\Huge The dielectric loss strength variation along an isomorph\\[1cm]                 }            \end{center}            \clearpage     \end{titlepage}


title: Lists of Figures and Tables is not generated: error

text: Finishing my twosided article, I want to generate the LOF and LOT. The following error occurs over and over for a lot of figures (the first being: "Undefined control sequence" and the second being: "Missing number treated as zero":               ! Undefined control sequence.     \l@figure #1#2->\ifnum \c@lofdepth                                         >\z@ \vskip \cftbeforefigskip {\leftskip ...     l.10 ...DPJIP2009}\relax }}{11}{figure.caption.14}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Missing number, treated as zero.     <to be read again>                         >     l.10 ...DPJIP2009}\relax }}{11}{figure.caption.14}          A number should have been here; I inserted `0'.     (If you can't figure out why I needed to see a number,     look up `weird error' in the index to The TeXbook.)      I use PDFLATEX via texstudio (MAC OSX) and \documentclass[11pt,a4paper,twoside,openany]{book}. I also just updated all packages, no difference (did not reboot computer). I hope someone can help.


title: Rescaling ticks

text: I have created a simple 2D plot from a table (xy-data) and now I would like to both translate and scale the x-axis. (I would prefer not to scale the actual data only the axis). As an example, let's say the x-values runs between (a,b) and I now want them to be between (0,1) instead. How would I go about doing this? I have found an example on how to subtract a constant but I cannot get it to work with multiplication. Any help would be much appreciated.               \documentclass{article}     \usepackage{pgfplots}     \begin{document}          \begin{tikzpicture}     \begin{axis}[scaled x ticks=manual:{}{%      \pgfmathfloatcreate{1}{6.0}{0}%     \pgfmathfloatsubtract{#1}{\pgfmathresult}%     }]      \addplot coordinates {     (6, 2)     (8, 3)     };     \end{axis}      \end{tikzpicture}          \end{document}


title: How to fix a contour plot at top of a 3D box

text: I want to fix a contour plot at the top of a 3D box. The following code sets the contour plot to the base:               \documentclass{scrartcl}     \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \begin{document}          \begin{figure}     \centering     \begin{tikzpicture}     \begin{axis}[             width=0.9\textwidth,             3d box,             view={20}{8},             plot box ratio=3 15 3,               colormap/jet,             colorbar,             ylabel={y},             xlabel={x},                  ]     \addplot3[raw gnuplot,              surf,           samples=29,           samples y=80,           ]      gnuplot[surf,         ]{         n=1e-5;         b=100;         h=10;         p=-0.0001;         set samples 29,80;         set isosamples 29,80;         K=((16*b**2)/(n*pi**3))*(-p);     Sum(i,x,y)=K*(((-1)**(0.5*((2*i-1)-1)))*(1-((cosh(((2*i-1)*pi*x)/(2*b)))/(cosh(((2*i-1)*pi*h)/(2*b)))))*((cos(((2*i-1)*pi*y)/(2*b)))/((2*i-1)**3)));         u(i,x,y)=(i==0)?0:(u(i-1,x,y)+Sum(i,x,y));         splot [-h:h] [-b:b] u(25,x,y)/u(25,0,0);         };     \addplot[raw gnuplot,           %thick,           color=black,           ]     gnuplot[]{         set contour base;         set cntrparam levels discrete 0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9;         unset surface;         set isosamples 100;         n=1e-5;         b=100;         h=10;         p=-0.0001;         K=((16*b**2)/(n*pi**3))*(-p);     Sum(i,x,y)=K*(((-1)**(0.5*((2*i-1)-1)))*(1-((cosh(((2*i-1)*pi*x)/(2*b)))/(cosh(((2*i-1)*pi*h)/(2*b)))))*((cos(((2*i-1)*pi*y)/(2*b)))/((2*i-1)**3)));         u(i,x,y)=(i==0)?0:(u(i-1,x,y)+Sum(i,x,y));         splot [-h:h] [-b:b] u(25,x,y)/u(25,0,0);         };     \end{axis}     \end{tikzpicture}     \end{figure}     \end{document}      ![](http://i.stack.imgur.com/8oIk2.png) I think the `z` filter doesn't work in this case. The gnuplot command "`set xyplane`" doesn't work in this context, too. Can I set the `z` level for this plot in any option? Is there a way to achieve the same result with less computing effort?


title: Footnotes per page spread

text: Now, I heard of footnotes per page, section, chapter, part or document, used all of them, but recently I got a (strange?) request to have footnote counter reset _per page spread_ , i.e., after every odd page. The point thrown at me is the following: in a book, there should _never ever_ be the same footnote number present on both even and odd page in a page spread (as happens regularly when "perpage" footnote method is used), because the _page spread_ should be observed as a whole, not the _page_ alone. According to this, numbering the first footnote on both even and odd page with number 1 is unacceptable. So, my **question** is: what is the easiest and/or safest way to have footnote counter reset after every odd page, so that footnote numbering starts anew on every even page? In the example code below, footnote numbers should start anew on pages 2 and 4. Also, I'll appreciate any thought, theoretical explanation or reference which approves or disapproves this kind of footnote numbering.               \documentclass{book}          \begin{document}          First\footnote{A footnote}\par     First\footnote{A footnote}\par     First\footnote{A footnote}\par          \clearpage          Second\footnote{A footnote}\par     Second\footnote{A footnote}\par     Second\footnote{A footnote}\par          \clearpage          Third\footnote{A footnote}\par     Third\footnote{A footnote}\par     Third\footnote{A footnote}\par          \clearpage          Fourth\footnote{A footnote}\par     Fourth\footnote{A footnote}\par     Fourth\footnote{A footnote}\par          \clearpage          Fifth\footnote{A footnote}\par     Fifth\footnote{A footnote}\par     Fifth\footnote{A footnote}\par          \end{document}


title: Dot after thechapter in the ToC, but not in the body text?

text: How do I add a dot after `thechapter` in the ToC, but have no dot after `thechapter` in the body? Here's an MWE:               \documentclass{book}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{DejaVu Sans}     \setsansfont{DejaVu Sans}     \setmonofont{DejaVu Sans Mono}          % toc:     \usepackage{titletoc}     \titlecontents{chapter}     [1.5em]{\addvspace{\baselineskip}}     {\contentslabel{1.5em}\hspace*{0em}}     {}     {\titlerule*[1pc]{.}\contentspage}          \begin{document}          \tableofcontents          \chapter{foo}     \chapter{bar}     \chapter{baz}          \end{document}      I tried to define `thechapter` with dot before the ToC, and then redifine it with no dot after the ToC, but it doesn't work:               \renewcommand\thechapter{\Roman{chapter}.}     \tableofcontents     \renewcommand\thechapter{\Roman{chapter}}      **Edit** : Thanks to egreg, the solution is:               \usepackage[dotinlabels]{titletoc}      I also had to:               \renewcommand{\theequation}{\thechapter.\arabic{equation}}     \renewcommand\thefigure{\thechapter.\arabic{figure}}     \renewcommand\theproblem{\thechapter.\arabic{problem}.}      in order to have dot in the name of the figures, problems, etc.


title: How do \widowpenalty and \clubpenalty interact for a 2-line paragraph?

text: Sometimes `\\\\*` does not suffice to prevent a linebreak. Adding `{\widowpenalty10000 \par}` or `{\clubpenalty10000 \par}` helps if the separated line is paragraph-final and stranded at the top of a page ("widow") or paragraph-initial and stranded at the bottom of a page ("orphan"). Here is an example:               \documentclass{article}          \newcommand*{\twolines}{%       line 1 \\*       line 2 \par%     }     \newcommand*{\twolinesInseparable}{%       line 1 \\*       line 2 {\widowpenalty10000 \par}%     }          \begin{document}          \vspace*{32\baselineskip}     \twolines\twolines\twolines     \twolines\twolines\twolines     \twolines\twolines\twolines          \newpage          \vspace*{32\baselineskip}     \twolinesInseparable\twolinesInseparable\twolinesInseparable     \twolinesInseparable\twolinesInseparable\twolinesInseparable     \twolinesInseparable\twolinesInseparable\twolinesInseparable          \end{document}      In this code, the linebreak between pages 1 and 2 (`\twolines`) will split a 2-line chunk (despite the `\\\\*`), whereas this doesn't happen between pages 3 and 4 (`\twolinesInseparable`, which sets an "infinite" (`10000`) `\widowpenalty`). **Do these two parameters interact in a meaningful way for a 2-line paragraph?** (This is a theoretical question. I don't have a practical application right now other than the thought experiment of making sure that different macros that include a `\widowpenalty` or `\clubpenalty` don't conflict or create nonsensical or conflicting constraints.)


title: Feynmf -- Two loop correction

text: How to draw a two (or even more) loop diagrams using Feynmf? ![two loop correction to a 2-point function](http://i.stack.imgur.com/aa2Gv.png) I tried               \documentclass{article}     \usepackage{feynmp}     \begin{document}     \unitlength = 1mm     \begin{fmffile}{twoloop}     \begin{fmfgraph}(100,60)     \fmfleft{i}     \fmfright{o}     \fmf{fermion}{i,v1,o}     \fmf{fermion}{v1,v2,v1}     \fmf{fermion}{v2,v2}     \end{fmfgraph}     \end{fmffile}     \end{document}      but it didn't work. I plotted it using LaTeXit. The one loop diagram worked just fine so I guess it's the problem with my usage of Feynmf.


title: What option suppresses axes, ticks and labels in gridIIID?

text: I am interested in using the `\gridIIID` command but I don't want the box to have ticks, labels or axes I found the following line in the changelog: `4.20 2010-07-23 - activate keyword planmarks for gridIIID for supprsssing ticks and labels (hv)` does this mean that the options have not been implemented? Here is a MWE               \documentclass[11pt]{book}     \usepackage{pst-solides3d}     \begin{document}     \begin{pspicture}(-4,-4)(4,4)     \psset{lightsrc=viewpoint,viewpoint=20 40 20,Decran=30}     \defFunction[algebraic]{curva3D}(t){cos(2*t)}{sin(t)}{t}     \defFunction[algebraic]{curvaXZ}(t){cos(2*t)}{-3}{t}     \defFunction[algebraic]{curvaYZ}(t){-4}{sin(t)}{t}     \psset{object=courbe,range=-2 2,r=0,resolution=360}     \psSolid[function=curvaXZ,linecolor=gray]     \psSolid[function=curvaYZ,linecolor=gray]     \psSolid[         function=curva3D,         linecolor=blue,         linewidth=2pt     ]     \gridIIID[Zmin=-2,Zmax=2,axisnames={,,},labels=none,ticks=none](-4,4)(-3,3)     \end{pspicture}     \end{document}      And an image for anyone wondering ![enter image description here](http://i.stack.imgur.com/WTop4.png)


title: Spacing problem with xpinyin

text: The `xpinyin` package provides a way to annotate Chinese characters with their Latin phonetic transcriptions. For characters with multiple pronunciations, one would use               \xpinyin{<character>}{<pronunciation>}      to provide the correct phonetic transcription. However, `\xpinyin` doesn't seem to obey the spacing settings of the `pinyinscope` environment, as illustrated in the following example (notice the overlap of `duan` and `xiang`):               \documentclass{article}     \usepackage{xcolor}     \usepackage[UTF8]{ctex}     \usepackage{xpinyin}     \xpinyinsetup{multiple={\color{red}}}          \begin{document}     \kaishu       \begin{pinyinscope}[hsep=1ex]     長短相形，\xpinyin{長}{chang2}短\xpinyin{相}{xiang4}形     \end{pinyinscope}     \end{document}      ![enter image description here](http://i.stack.imgur.com/KjLGn.png) The problem remains if the option `hsep=1ex` is given when loading the package. **How to solve this problem?**


title: Horizontal lines

text: ![enter image description here](http://i.stack.imgur.com/KZtkP.png)In my header of a page in documentclass scrbook there should be two horizontal lines with text in between. This was my idea:               \begin{minipage}{12cm}     {\color{black}\rule{12cm}{0.7mm}}     \begin{center}     {\Large\textbf{Musterklausur Nr. 1}\\[3mm]     \textbf{Lösungsvorschlag}}     \end{center}     {\color{black}\rule{12cm}{0.7mm}}     \end{minipage}      Before i have made a pagebreak. My problem ist that the folowing text has no distance to the lower line. When I put a \vspace*{4mm} in the text goes down till the half of the page. Can somebody help?


title: Standalone: unique page per equation without white space

text: I'd like to create a document with several formulas and each formula is supposed to stand alone on a page. Here is an example:               \documentclass[preview,varwidth ,multi,border=1pt]{standalone}     \usepackage{amsmath}     \def\D{\mathrm{d}}          \begin{document}     %(i)     \preview     $\int^{10}_0{\frac{1}{2}\D t}$     \endpreview          %%(ii)     \preview     $$\int^{10}_0{\frac{1}{2}\D t}$$     \endpreview          %%(iii)     \preview     \begin{align}     \int^{10}_0{\frac{1}{2}\D t}\\     \int^{10}_0{\frac{1}{2}\D t}     \end{align}     \endpreview          \end{document}      The first version (i) works actually quite fine, however I don't like the compressed int sign of the inline math mode. While in the second version (ii) there is a white space. Is it possible to get a standalone equation without white space? Regards \edit: Thanks for the quick response. It works fine. I just relized that I have to deal with systems of equations as well. That is some equations are supposed to stand alone and some should stand together on one page. See the additional (iii) above, where the white space still occurs. Any suggestions?


title: problem with multirow: text runs out of a cell bound

text: ![Table](http://i.stack.imgur.com/hKaCI.png) As shown in the attached picture, text runs out of the cell bound. I'd appreciate it if someone could help me fix the problem.               \begin{table}[!htbp]     \centering     \caption{Experiment outline}     \label{tab:exp_process}     \begin{tabular}{|l|l|l|m{6cm}|}         \hline         Sessions & Objectives & Groups & Activities         \\         \hline\hline         \multirow{2}{*}{$1$st session} &          \multirow{2}{4cm}{Learning the basics of thermal conduction} &          Control &          \multirow{1}{6cm}{Solve a thermal system design problem using a real-time high-fidelity simulation with the CPU heat sink system}         \\                                       &                            & Experimental &          \\         \hline     \end{tabular}     \end{table}


title: mdframe size not matching table size

text: I'm having some problems with the `mdframed` package in combination with `tabular`. After figuring out how to get the width of the frame to match the width of the object (a table in my case) using a hack described here, there's not the same space from the table to the frame on either side. ![enter image description here](http://i.stack.imgur.com/19G21.png) It somehow seems there there is a bit more space on the left side, around 30%. Here's a MWE:               \documentclass[a4paper,12pt]{article}     \usepackage{environ}     \usepackage{varwidth}     \usepackage{siunitx}     \usepackage[version=3]{mhchem} % den nemmeste måde at skrive kemiske navne     \usepackage[framemethod=TikZ]{mdframed} % frame i images/figures     \newlength{\MyMdframedWidthTweak}%     \NewEnviron{MyMdframed}[1][]{%         \setlength{\MyMdframedWidthTweak}{\dimexpr%             +\mdflength{innerleftmargin}             +\mdflength{innerrightmargin}             +\mdflength{leftmargin}             +\mdflength{rightmargin}             }%         \savebox0{%             \begin{varwidth}{\dimexpr\linewidth-\MyMdframedWidthTweak\relax}%                 \BODY             \end{varwidth}%         }%         \begin{mdframed}[             linecolor=red,             linewidth=3pt,             roundcorner=5pt,             userdefinedwidth=\dimexpr\wd0+\MyMdframedWidthTweak\relax,              #1]             \usebox0         \end{mdframed}     }     \begin{document}     \begin{MyMdframed}     \begin{tabular}{l r}         Trivialnavn & vanillin \\         Sumformel & \ce{C8H8O3} \\         Kemisk struktur & \ce{(CH3O)C6H3(OH)CHO} \\         IUPAC & 4-hydroxy-3-methoxybenzaldehyde \\         CAS nummer & 121-33-5 \\         Farve & hvid-gullig \\         Duft & behagelig, blomstret \\         Molarmasse & \SI{152,15}{\gram\per\mole} \\         Smeltepunkt & \SI{82}{\celsius} \\         Kogepunkt & \SI{170}{\celsius} \\         Kilde & Wolfram|Alpha \& Databogen     \end{tabular}     \end{MyMdframed}     \end{document}      Not exactly minimal, but you get the point. I figured it was something in relation to the way the width of the table is calculated, but I have no idea how to adjust it. I got the same problem when using plain `tikz` for the task as described here.


title: Missing number, treated as zero. <to be read again> while inserting figures

text: \documentclass[aip,amsmath,amssymb,preprint]{revtex4-1}     \usepackage{epsfig,graphicx,graphics,dcolumn,bm,textcomp}     \usepackage{fixltx2e}     \begin{document}     \begin{figure}\includegraphics{conc}\caption{\label{figepsart} A figure caption. The figure captions are automatically numbered.}\end{figure}     \end{document}


title: How do I create a PDF file that can be digitally signed?

text: We are using Acrobat digital signatures in my organization. With Acrobat Professional you can put in a signature block that allows signing with a client-side digital signature. This is something that can be then done by someone using Acrobat Reader. This is not the same as adding a digital signature to the document—this is adding a space where a signature can be added by someone else to indicate acceptance of the produced PDF. How do I create a PDF file with LaTeX that can be digitally signed?


title: pst-eucl labels

text: I just tried giving pst-eucl a spin, but I am struggling with the label positions. When trying the following example from the documentation                   \begin{pspicture}(-2,-2)(2,2)             \pstTriangle[PointSymbol=square, PointSymbolC=o,                          linecolor=blue, linewidth=1.5\pslinewidth]                          (1.5,-1){A}(0,1){B}(-1,-.5){C}         \end{pspicture}      All the labels seems to apear in (0,0), overlapping each other. **UPDATE** Marco's tips in the comments of his reply resolved the issues.


title: newcommand object not included in pstricks picture

text: I use to have old latex docs that included pstricks pictures. I had to define objects that I could reuse several times in the pictures and did this with a newcommand/def (and everything was fine). I recently had to compile these files and it's not working anymore: objects defined in the newcommand line isn't displayed. I've tried to show a short, non-working, example:               \documentclass{article}     \usepackage{pdftricks}     \begin{psinputs}         \usepackage{pstricks}     \end{psinputs}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{document}     \newcommand*{\example}{\qline(0,0)(1,1)}          \begin{pdfdisplay}         \begin{pspicture}(3,3)            \qline(0,0)(1,1) %this line displays correctly            \rput(1,0){\qline(0,0)(1,1)}  %this line displays correctly            \rput(2,0){\example}  %this line isn't displayed!         \end{pspicture}     \end{pdfdisplay}      \end{document}      In the above code, the first two lines are correctly drawn, but the third isn't. I've been fighting for hours with it and can't figure out what's wrong. The only piece of information I managed to understand is that the figure is wrapped in a tex file, then compiled in postscript, then transformed in pdf AND that the \example code isn't passed with it:               %%% This is the example-fig1.tex automatically generated file     \documentclass{article}     \input tmp.inputs     \pagestyle{empty}     \begin{document}         \begin{pspicture}(3,3)            \qline(0,0)(1,1) %this line displays correctly            \rput(1,0){\qline(0,0)(1,1)}  %this line displays correctly            \rput(2,0){\example}  %this line doesn't display!         \end{pspicture}          \end{document}      Help would be really appreciated! Thanks.


title: Using \BeforePackage to load a package before hyperref does not work

text: I am using the `lipics` document class, which includes `hyperref`. I want to load the `float` package, which should be loaded before `hyperref`, without changing the document class. As suggested in this comment, I am trying to use the `KOMA-Script` called `scrlfile` ( _cf._ page 199 of the documentation), in the following way               \documentclass{lipics}     \usepackage{scrlfile}     \BeforePackage{hyperref}{       \usepackage{float}     }     ...      however it never loads the package. What I am doing wrong?


title: Write a LaTeX macro to differentiate the text

text: I'm writing a report, and, for editorial purposes, I would like to use different fonts for each part of the report. I think I need to write a macro for it, but I don't know how to have this effect:               \begin{editLater}     //Use times font for this          \end{editLater}      Or               \begin{finalVersion}     //Use new roman font for this          \end{finalVersion}


title: LyX handles the bibliography environment incorrectly

text: Related to this question: Does someone know, why LyX, when I create a bibliography via the "bibliography" module, inserts as the second argument the title of the bibliography section instead of a string, representing the largest label ? So if I would like to have 12 entries in my bibliography and insert the bibliography environment via the appropriate module, by looking at the source code, Lyx inserts `\begin{thebibliography}{References}` instead of `\begin{thebibliography}{99}` as its supposed to be. (Or at least a different number other that 99 since at the time of creating the bibliography environment LyX doesn't know yet how many entries there are in that.) So can someone tell me how I can make LyX correctly handle the bibliography environment ? (Of course I can use "evil red code" to achieva what I want, but this is not elegant).


title: How do I put a musical clef in a memoir-class document?

text: I've got a lot of questions about preparing a book layout, but as I'm slowly going through the various books and other documents out there, I think most of the questions are being answered. However, the answer to the question How can I put musical clefs in the middle of text? doesn't work for my use-case, which is that I want to use a musical treble clef () as a section separator. I first tried with XeTeX and the direct unicode input (as shown):               \documentclass[msmallroyalvopaper,12pt,openany]{memoir}     \usepackage{fontspec,xltxtra,xunicode}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont{Baskerville}     \begin{document}     \part*{1980}     \chapter*{Chapter One}     \section*{}     \end{document}      This didn't work despite the Mac OS X Baskerville font having the treble clef in its Unicode range (I know as I have a Pages document that does this); all that shows up is the unknown character box (). So, I try the solution in the linked question:               \documentclass[msmallroyalvopaper,12pt,openany]{memoir}     \usepackage{fontspec,xltxtra,xunicode,musixtex}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont{Baskerville}     \begin{document}     \part*{1980}     \chapter*{Chapter One}     \section*{\begin{music}\trebleclef\end{music}}     \end{document}      and this refuses to compile (I'm using TeXShop and forcing XeTeX), resulting in this message:               ? musixtex/musixtex.tex:531: Class     memoir Error: Font command \rm is not supported.          See the memoir class documentation for explanation.      I have an SVG of a treble clef that I can use (I needed it for an earlier ebook book), but I'd rather just use normal font commands because I don't really want to have to worry about scaling this independently of the font size. Does anyone know of a memoir-compatible solution for this? Or should I stop learning memoir-class and learn how to do what I need in ConTeXt or KOMA or is there something else that I should be doing?


title: What is the kvoptions-patch's equivalent of \@classoptionslist?

text: For a class I'm working on, I'd like some (`babel`'s) languages to be automatically loaded. This can be achieved thanks to `\@classoptionslist`:               \begin{filecontents*}{myclass.cls}     \NeedsTeXFormat{LaTeX2e}     \RequirePackage{xkeyval}%     \RequirePackage{xifthen}     \ifthenelse{\equal{\@classoptionslist}{}}{%       \edef\@classoptionslist{spanish,french,english}%     }{%       \edef\@classoptionslist{spanish,french,english,\@classoptionslist}%     }%     \RequirePackage{babel}%     \LoadClass{article}     %     \end{filecontents*}     %     \documentclass{myclass}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \begin{document}     \begin{itemize}     \item\selectlanguage{french} \iflanguage{french}{In French}{Not in French}     \item\selectlanguage{english} \iflanguage{english}{In English}{Not in English}     \item\selectlanguage{spanish} \iflanguage{spanish}{In Spanish}{Not in Spanish}     \end{itemize}     \end{document}      But I'd also like to use `kvoptions-patch`. Because this package redefines `\@classoptionslist`, the trick above doesn't work. AFAIU its code (not very far! :), I thought the `kvoptions-patch`'s equivalent of `\@classoptionslist` was `\XKV@classoptionslist` but the following MWE shows that I should be wrong:               \begin{filecontents*}{myclass.cls}     \NeedsTeXFormat{LaTeX2e}     \RequirePackage{kvoptions-patch}[2011/06/30]%     \RequirePackage{xkeyval}%     \RequirePackage{xifthen}     \ifthenelse{\equal{\XKV@classoptionslist}{}}{%       \edef\XKV@classoptionslist{spanish,french,english}%     }{%       \edef\XKV@classoptionslist{spanish,french,english,\XKV@classoptionslist}%     }%     \RequirePackage{babel}%     \LoadClass{article}     %     \end{filecontents*}     %     \documentclass{myclass}     \makeatletter     \message{^^J^^JXKV@classoptionslist=\XKV@classoptionslist^^J^^J}     \makeatother     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \begin{document}     \begin{itemize}     \item\selectlanguage{french} \iflanguage{french}{In French}{Not in French}     \item\selectlanguage{english} \iflanguage{english}{In English}{Not in English}     \item\selectlanguage{spanish} \iflanguage{spanish}{In Spanish}{Not in Spanish}     \end{itemize}     \end{document}      Indeed, though the message in the `.log` file displays the expected `XKV@classoptionslist=spanish,french,english`, the compilation fails with error messages: `! Package babel Error: Unknown language 'english'` and `! Package babel Error: Unknown language 'spanish'` (but, strangely enough, 'french' is correctly detected). Hence my question: what is the `kvoptions-patch`'s equivalent of `\@classoptionslist`?


title: concrete font for text in matplotlib

text: I have matplotlib figures with labels, which are included as PDF in LaTeX document. I would like label text match with the font of the text, which is concrete (via `\usepackage{concrete}`). I can change math font in labels with               import matplotlib as mpl     mpl.rcParams['text.usetex']=True     mpl.rcParams['text.latex.preamble']=[r'\usepackage{euler}']      but adding `\usepackage{concrete}` has no effect on the text font (probably since the default Helvetica is used regardless). usetex documentation does not mention concrete to be supported directly. I also have the `cm-unicode` opentype variants of CMU fonts (CMU Concrete) installed, in case that could be of any use.


title: Reducing the space between the \title and the first line of the the abstract in IEEEtran

text: I am trying to reduce the space between the title and the abstract (the paper have no authors). IEEETran style is being used. I tried the `\vspace` command but it didn't work, any ideas, recommendations? Just to be clear I have something like this:               \documentclass[10pt,conference]{IEEEtran}     \begin{document}     \title{Some Title}     \maketitle     \begin{abstract}     This is for test text...     \end{abstract}     \end{document}      I want to reduce the vertical space between "Some Title" and "This is...."


title: TikZ: extend a line along a path

text: I would like to extend a line. I could find the angle and then use `(\angle:\radius)` to do this. I was wondering if there is a way to execute this command without having to do the math. ![enter image description here](http://i.stack.imgur.com/HPO2r.png) In the image, we have a concave lens with the focus labelled as `F`. I want to draw lines that are on the same path from the focus to `(0, \y cm)` but I only want the section of the line that starts at `(0, \y cm)` and moves outwards from the paraxial rays.               \documentclass[tikz]{standalone}          \usetikzlibrary{decorations.markings}          \begin{document}     \begin{tikzpicture}       \pgfmathsetmacro{\lH}{1}       \pgfmathsetmacro{\lR}{2}       \pgfmathsetmacro{\sA}{asin(\lH/\lR)}       \pgfmathsetmacro{\base}{1}       \pgfmathsetmacro{\xshi}{\base/2}            \draw[yshift = -2cm, xshift = -\xshi cm] (0, \lH cm)       arc[start angle = -\sA, delta angle = 2*\sA, radius = \lR cm] --       +(\base cm, 0)       arc[start angle = 180 - \sA, delta angle = 2*\sA, radius = \lR cm]        -- cycle;            \begin{scope}[decoration = {           markings,           mark = at position 0.1 with {\arrow{stealth}},           mark = at position 0.75 with {\arrow{stealth}}         }         ]         \foreach \y in {0.5, 0.25, 0, -0.25, -0.5}{           \draw[postaction = decorate] (-1.5cm, \y cm) -- (0, \y cm) %extend lines along the path command here;         }       \end{scope}            \fill[fill = black] (-1cm, 0) circle[radius = 0.015cm] node[below,       font = \tiny] {$F$};      \end{tikzpicture}     \end{document}


title: Transferring Lyx Keyboard Shortcuts

text: I recently updated my version of Lyx from 1.6.7 to 2.0.6. I would like to transfer my old keyboard shortcuts to this new version, but I am having difficulty because I was inconsistent with the way that I set them up: Some were defined in the specified .bind file, but others were modified in the lyx preferences menu. I found that when importing my old .bind file into this updated version of lyx, it imported the keyboard shortcuts that were in the .bind file, but not those that I had added in the preferences menu. Does anyone know if these keyboard shortcuts that were added via the preferences menu are stored in another .bind file somewhere in the lyx directory? Has anyone else successfully transferred keyboard shortcuts that had been implimented in the preferences menu?


title: Changing footnote symbol within mdframed

text: Am having difficulty changing the footnote symbol, especially within an `mdframed` environment. I thought I was done when I came across Changing footnote symbols, but the accepted solution (commented out in the MWE) does not seem to work for me. Then I tried the               \renewcommand{\thefootnote}{$\dagger$}      which seems to work, but not inside an `mdframed` environment, even if I issue the `\renewcommand` after the `\begin{mdframed}`: ![enter image description here](http://i.stack.imgur.com/jBBoI.png) ## References:   * Changing footnote symbols ## Notes:   * For this particular use case I really _only_ want one symbol. But having a solution that actually works and allows for multiple symbols is fine with me. ## Code:               \documentclass{article}     \usepackage[textheight=3cm, textwidth=9cm]{geometry}     \usepackage{mdframed}          %% This at least produces the dagger outside of mdframed     \renewcommand{\thefootnote}{$\dagger$}%          %%% http://tex.stackexchange.com/questions/78221/changing-footnote-symbols     %%% This yields a numerical value outside of mdframed and an alphabetical foot note inside mdframed     %\makeatletter     %\def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or     %   \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger     %   \or \ddagger\ddagger \else\@ctrerr\fi}}     %\makeatother               \begin{document}          This\footnote{Outside of Mdframed a dagger is used as desired.} is a footnote outside of mdframed.          \begin{mdframed}     \renewcommand{\thefootnote}{$\dagger$}% <-- This seems to have no effect.     This\footnote{Want a dagger for footnotes inside of Mdframed} is a footnote inside mdframed.     \end{mdframed}          \end{document}


title: Have the chapter title stick out of the type area

text: I'm trying to place my chapter titles to the edge of the page, with a colored background box surrounding them. The surrounding boxes would need to be set outside of the body of the document. So far I have read the documentation of typearea, geometry, layouts, titlesec, TikZ and others but haven't been able to find a solution. See http://latex-project.org/guides/lb2-ch4.pdf for an example of the effect I want to achieve. There the chapter title reaches farther right than the text body. What I want is to have my chapter titles in a a colored box similar to the headings on the 2nd page of the attached document on the left edge on the page. Here is the code for the box. I just need a way to place it on the left page edge.               \documentclass[a4paper,12pt]{report}          \usepackage{tikz}     \usepackage[uppercase, sf, explicit, raggedright]{titlesec} %     \usepackage{xcolor}          \makeatletter     \titleformat{\chapter}     {\sffamily\huge\bfseries}     {}     {0pt}     {         \usetikzlibrary{backgrounds}         \tikzstyle{background rectangle}=[fill=cyan]         \begin{tikzpicture}[framed]         \color{white}            \draw (0,0) +(3ex,0) node[anchor=west]{Chapter \thechapter{} \filright#1};         \end{tikzpicture}     }     \makeatother     \begin{document}     \chapter{Chaptertitle}     \end{document}


title: Font in harvmac title

text: harvmac is an old set of macros for scientific documents in plain TeX. I can't figure out what font is used for the title produced by harvmac, and how I could use the same font in LaTeX. Here's an example:               \input harvmac     \Title{}{Your title goes here}     \end      You need to compile this with plain TeX, and you get this: ![enter image description here](http://i.stack.imgur.com/5ozhT.jpg) As you can see the font is slightly thicker than normal (i.e. thicker than what you'd get by using `\huge` or `\Huge` in LaTeX), but it is not bold. This font is some variant of Computer Modern. How can I use the same font in LaTeX?


title: how to better control the number display of listings?

text: I'm using the `listings` package for my sourcecodes, and among other things to control the display of those, I'm using `\lstset`, obviously. Now, When setting `numberstyle`, I've set them to `\sffamily\tiny\color{gray}`. Now this all works alright, because those all works as switches inside an environment. But what If I need the numbers inside an environment? Namely, I'd like to raise the numbers a little with `\raisebox{}{}`. But how do I put the line number in question into that command? Basically, they have to go into the second set of curly braces. How do I do that? As requested, here's the example:               \documentclass[a4paper, 11pt]{scrartcl}     \usepackage{listings}          \lstset{         numbers=left,         numberstyle=\sffamily\tiny,     }          \begin{document}     \begin{lstlisting}[title=test]     for i:=maxint to 0 do     begin         { do nothing }     end;          Write("Case insensitive")     WritE("Pascal keywords.")          a = 'a' -- comment     \end{lstlisting}     \end{document}      As you can see, I've set `numberstyle` to the switches I want to, but how am I supposed to put an environment in there, where the number is supposed to be put into?


title: Add new toc-type showing different section levels

text: All references I found so far on the subject only show how to set the number of levels shown in a table of contents (through `\setcounter{tocdepth}{n}`. But I would like to define a new (additional) type of toc that lists all sections _below_ a given sectioning level. For example I would like to print a toc at the beginning of each `\part`, listing everything starting with `\chapter`. (This is especially important if the parts are in subfiles that I also would like to be compilable as standalone documents. Is there a place (variable, command) where I can define the top level of a toc? Or are there packages for this purpose? Thanks for any hints.


title: Create an array of variables with string keys

text: I'd like to have a macro where I can insert a key as argument and get a value which I have defined before. This should be similar to Create an array of variables but with strings/text instead of numbers. The usage should look like:               \setprefix{foaf}{http://xmlns.com/foaf/0.1/}      and later               \getprefix{foaf}      which should return `http://xmlns.com/foaf/0.1/`. When I try to use the code from the before mentioned question I get `! Illegal parameter number in definition of`.


title: Index with accented letters

text: I'm trying to typeset the following               $Q_å=l_å \cdot m$      But LaTeX won't typeset these special or accented letters in my document! Is there a simple way to achieve this?


title: Drawing a multiscale network in Tikz

text: I am learning TikZ in this period, but I have some problems drawing some networks for my thesis. I am trying to draw a network in TikZ which should look similar to the one in `this picture`: ![enter image description here](http://i.stack.imgur.com/YAA4T.png) I have written the following code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary[topaths]     \newcount\mycount     \begin{document}     \begin{tikzpicture}[transform shape]       \foreach \x in {1,...,8}{         \pgfmathparse{(\x-1)*45+floor(\x/9)*22.5}         \node[draw,circle,inner sep=0.25cm] (N-\x) at (\pgfmathresult:5.4cm) {};       }            \foreach \x [count=\xi from 1] in {1,...,8}{         \foreach \y in {\x,...,8}{         \path (N-\xi) edge[-] (N-\y);       }     }     \end{tikzpicture}     \end{document}      It draws just one of the cliques of the image. Could you help me drawing the entire network shown in the picture? Thank you.


title: Draw string with linking numbers or no linking number?

text: How can I use LaTex (p.s. I use Mac OS 10.5.8 with TexShop 2.47) to draw strings with linking numbers or no linking numbers? If any experts know any examples below, please feel free to comment. The answer needs not to completely solve everything. Here are the three examples: Fig. 1. No Link: ![enter image description here](http://i.stack.imgur.com/VjibQ.gif) Fig. 2. Link = 1: ![enter image description here](http://i.stack.imgur.com/5bWiT.gif) Fig. 3. Link = 2: ![enter image description here](http://i.stack.imgur.com/TFjQD.png) Fig. 4. Borromean Ring: ![enter image description here](http://i.stack.imgur.com/p7qjk.jpg)


title: Case equation without curly brace

text: I want to have a `case equation` without the left `curly brace`. I am using               \documentclass[11pt,a4paper]{article}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{amsthm}          \begin{document}         \begin{equation}         \begin{cases}         \frac{I}{Z}=12+\frac{7}{Z}[eV] & ,Z<13 \\         \frac{I}{Z}=9.76+58.8Z^{-1.19}[eV] & ,Z\geq13  \\         \end{cases}         \end{equation}     \end{document}      which is perfect for my case, except for the big, left curly brace!


title: How can I install a Chinese font in a Ubuntu 13.10 in a way that xelatex can see it?

text: I am trying to make the second example from the answer here work. It is copied here below:               % Compile with xelatex     % UTF-8 encoding     \documentclass{article}     \usepackage{xeCJK}     \setCJKmainfont{SimSun}     \begin{document}     文章内容     \end{document}      When I compile with `xelatex Test.tex`, I get the following error indicating that it cannot find the font.               The font "SimSun" cannot be found.      I can think of two possible solutions, but I am unclear about how to proceed with either of them, and Google has not been helpful. 1) Install SimSun. What is the correct command in `Ubuntu 13.10` to do this so that xelatex can see it? 2) Change to a different Chinese font that `xelatex` will work with. I can type Chinese in my Ubuntu install, so I must have some kind of Chinese font on my system. How can I find out the names of all fonts which are valid arguments to `\setCJKmainfont`? Note that I already have `msttcorefonts` package installed.


title: Formatting a logical (PD) derivation

text: I'm trying to format a PD derivation but I'm having trouble getting subderivations to display well. Essentially what I'm trying to accomplish is this:               1 | P          Assumption     2 | Q          Assumption       ------------     3 | P v Q      1, 2 vI     4 | | P        A / vE       | --------     5 | | R     6 | R      The above is all nonsense but it shows the format I need. Basically, I need one column for line numbers followed by a vertical line, a horizontal line under assumptions ("A" also means assumption) and a third column explaining the derivation rule I used with the corresponding line numbers. Without the subderivation I can do it with tables like this:               \begin{tabular}{l | l l}       1 & P & Assumption \\       2 & Q & Assumption \\ [0.5ex] \cline{2-2} \\ [-1.9ex]       3 & P v Q & 1, 2 vI \\     \end{tabular}      For a little more detail, the vertical bars and their associated horizontal bar should be connected and the vertical bars for the subderivations should be spaced so they're pretty close to being underneath the first character of the line above it. I thought about making a new table inside the whole table for each subderivation, but I feel like that would mess up the line numbering since it would only occupy a single cell. Any suggestions as to how I should lay this out are greatly appreciated. Here's an image of the desired layout (added by Gonzalo Medina, from an image linked in a comment): ![enter image description here](http://i.stack.imgur.com/41VDq.png)


title: Tikzcd graph gives me: Typesetting problem in main.tex Too wide error

text: I made a graph which looks good in the pdf. But now latex keeps telling me it's too wide and I have no idea how to compress this thing.               \[     \begin{tikzcd}                                                                                &F_{4}=G_{4} \arrow{dr} \arrow{dl} \arrow{d} \\     \triangle_{3,1}(F_{4})=\triangle_{3,1}(G_{4}) \arrow{d} \arrow{dr}          &\triangle_{2,2}(F_{4})=\triangle_{2,2}(G_{4})    \arrow{dl} \arrow{dr}     \arrow{d}        &\triangle_{1,3}(F_{4})=\triangle_{1,3}(G_{4}) \arrow{d} \arrow{dl}\\     \triangle_{2,1,1}(F_{4})=\triangle_{2,1,1}(G_{4})  \arrow{dr}               & \triangle_{1,2,1}(F_{4})=\triangle_{1,2,1}(G_{4})         \arrow{d}                        & \triangle_{1,1,2}(F_{4})=\triangle_{1,1,2}(G_{4}) \arrow{dl}\\                                                                                & \triangle_{1,1,1,1}(F_{4})=\triangle_{1,1,1,1}(G_{4})     \end{tikzcd}     \]


title: Decorated path and arrows

text: I have defined 2 decorations with this code:               \documentclass{article}     \usepackage{tikz}          \begin{document}     \thispagestyle{empty}     \usetikzlibrary{decorations}          \tikzset{%         pneumatic signal/.style={%             decoration={%                 pneumatic signal decoration,                 segment length=6pt,                 amplitude=3pt             },             very thin,             decorate         }     }               \tikzset{%         system signal/.style={%             decoration={%                 system signal decoration,                 segment length=10pt,                 amplitude=5pt             },             very thin,             decorate         }     }               \makeatletter          \pgfdeclaredecoration{pneumatic signal decoration}{line}     {%         \state{line}[width=+\pgfdecorationsegmentlength,next state=tick,%                 switch if input segment less than=.5\pgfdecorationsegmentlength %                     to segment 1,%                 switch if input segment less than=+\pgfdecorationsegmentlength %                     to segment 2]{%             \pgfpathlineto{\pgf@x=+\pgfdecorationsegmentlength \pgf@y=0pt}         }         \state{tick}[width=1.6\pgfdecorationsegmentamplitude,next state=line,                 switch if input segment less than=1.2\pgfdecorationsegmentamplitude%                         to segment 2]{%                 \pgfpathlineto{\pgf@x=1.6\pgfdecorationsegmentamplitude \pgf@y=0pt}                 \pgfpathmoveto{\pgf@x=0pt \pgf@y=-.5\pgfdecorationsegmentamplitude}                 \pgfpathlineto{\pgf@x=+\pgfdecorationsegmentamplitude                     \pgf@y=.5\pgfdecorationsegmentamplitude}                 \pgfpathmoveto{\pgf@x=.6\pgfdecorationsegmentamplitude                     \pgf@y=-.5\pgfdecorationsegmentamplitude}                 \pgfpathlineto{\pgf@x=1.6\pgfdecorationsegmentamplitude                     \pgf@y=.5\pgfdecorationsegmentamplitude}                 \pgfpathmoveto{\pgf@x=1.6\pgfdecorationsegmentamplitude \pgf@y=0pt}         }         \state{segment 1}[next state=line,%                 width=+\pgfdecoratedinputsegmentremainingdistance]{%             \pgfpathlineto{\pgfpointdecoratedinputsegmentlast}         }         \state{segment 2}[next state=segment 3,%                 width=+\pgfdecoratedinputsegmentremainingdistance]{%             \pgfpathlineto{\pgfpointdecoratedinputsegmentlast}         }         \state{segment 3}[next state=tick,%                 width=.2\pgfdecorationsegmentlength,                 switch if input segment less than=.2\pgfdecorationsegmentlength %                     to segment 2]{%             \pgfpathlineto{\pgf@x=.2\pgfdecorationsegmentlength \pgf@y=0pt}         }         \state{final}{%             \pgfpathlineto{\pgfpointdecoratedpathlast}         }     }          \pgfdeclaredecoration{system signal decoration}{line}     {%         \state{line}[width=+\pgfdecorationsegmentlength,next state=symbol,%                 switch if input segment less than=.5\pgfdecorationsegmentlength %                     to segment 1,%                 switch if input segment less than=+\pgfdecorationsegmentlength %                     to segment 2]{%             \pgfpathlineto{\pgf@x=+\pgfdecorationsegmentlength \pgf@y=0pt}         }         \state{symbol}[width=+\pgfdecorationsegmentamplitude,next state=line,                 switch if input segment less than=+\pgfdecorationsegmentamplitude%                     to segment 2]{%             \pgfpathcircle{\pgf@x=.5\pgfdecorationsegmentamplitude \pgf@y=0pt}                 {.5\pgfdecorationsegmentamplitude}             \pgfpathcircle{\pgf@x=.5\pgfdecorationsegmentamplitude \pgf@y=0pt}                 {.25\pgfdecorationsegmentamplitude}             \pgfpathmoveto{\pgf@x=+\pgfdecorationsegmentamplitude \pgf@y=0pt}         }         \state{segment 1}[next state=line,%                 width=+\pgfdecoratedinputsegmentremainingdistance]{%             \pgfpathlineto{\pgfpointdecoratedinputsegmentlast}         }         \state{segment 2}[next state=segment 3,%                 width=+\pgfdecoratedinputsegmentremainingdistance]{%             \pgfpathlineto{\pgfpointdecoratedinputsegmentlast}         }         \state{segment 3}[next state=symbol,%                 width=.2\pgfdecorationsegmentlength,                 switch if input segment less than=.2\pgfdecorationsegmentlength %                     to segment 2]{%             \pgfpathlineto{\pgf@x=.2\pgfdecorationsegmentlength \pgf@y=0pt}         }         \state{final}{%             \pgfpathlineto{\pgfpointdecoratedpathlast}         }     }     \makeatother          \tikz\draw[->,pneumatic signal] (0,0) -- (2,0);     \tikz\draw[->,system signal] (0,0) -- (2,0);          \end{document}      My problem is that I can't draw a path terminated by an arrow with the "system signal" decoration. Although the code is quite the same, I do not understand why the "pneumatic signal" decoration is working and not the "system signal" one. What do I miss? ![enter image description here](http://i.stack.imgur.com/jP9PO.png) **Edit:** add missing MWE code as requested (sorry...) **Edit2:** problematic decoration code added


title: In "math-mode line" non-math type

text: I'd like to type non-math text inside of the bracket math text lines, or know of a better way to do what I'm trying to do. In the following, I don't literally type \nomath. I don't know what I need to type there in order to make this work. **This is what I type** (the dashes are disappearing, I don't know why):               \begin{document}          \[ K=L \]          \[ A = B \nomath or \nomath A_1 = B_1\]          \end{document}      **This is what I get:** > K=L > > A=B > > or > > A_1=B_1 **This is what I want:** > K=L > > A=B or A_1=B_1 What I'd like for the or word to be in non-math text mode, with everything around it following the normal rules according to the dashes and brackets. Can anyone help me?


title: Problem executing script for latexdiff

text: I am a _LaTeX beginner and new to Scripting_. I try to implement this interesting solution for latexdiff and multiple files found in this question- answer before I begin writing my phd thesis. However using...   * Win7 (64-bit)   * GitHub (Sourcetree, Git version 1.8.0msysgit.0)   * MikTex 2.9    * ActivePerl version 5.16.2.1602   * cygwin and after researching I do not know how to execute the script and the documentation on the site linked above is "sparsely". Here is what I did so far:   * Latexdiff is installed and successfully tested   * 'latexbatchdiff.sh' is placed in `C:\Users\USER\Dropbox\Github` (added to PATH)    * Repository Path: `C:\Users\USER\Dropbox\Github\Testlab` My `C:\Users\USER\Dropbox\Github\Testlab\\.git\config`-file looks like this:               [core]         bare = false         repositoryformatversion = 0         filemode = false         logallrefupdates = true         symlinks = false         ignorecase = true     [remote "origin"]         url = https://github.com/MYGITHUBACCOUNT/Testlab.git         fetch = +refs/heads/*:refs/remotes/origin/*     [branch "master"]         remote = origin         merge = refs/heads/master     [difftool.latex]         cmd = latexdiff "$LOCAL" "$REMOTE"     [difftool]         prompt = false     [alias]         ldiff = difftool -t latex      There is also an 'install.sh' which is not documented at all, so I tried... ![trying install.sh and failing](http://i.stack.imgur.com/l7kvt.png) So, how does one execute this script on windows? Do I use the Windows CMD or the Cygwin Terminal? I would be really grateful for a beginner-friendly example. ![thats how far I got using cygwin](http://i.stack.imgur.com/yc5uS.png)


title: Odd result in pgfplots when scale and set layers is used together

text: I have a problem when I use `scale` and `set layers` in pgfplots. I have to use `set layers` because I want that several curves in one plot are above each other (that is not really visible in my example code below) and I want to use scale to make the plot and the labelling smaller. If you run my example code, you can see from the first figure that everything is fine if one uses `set layers` and `scale=1`. If one uses `scale=0.8` without `set layers`, everything works as expected (second figure; in my real plot the curves are not above each other anymore). But if one uses `scale=0.8` and `set layers`, an odd result is produced. The plot is smaller, but not the labelling. Also the legend is at wrong position. Who can tell me what I do wrong? I really have to use `set layers` together with `scale` so that my real plot looks fine. Here is the code I use:               \documentclass{report}     \usepackage{tikz}      \usepackage{pgfplots}     \pgfplotsset{compat=1.7}     \begin{filecontents}{TableQuestion.txt}     xValue1 yValue1     xValue2 yValue2      1   0     1   0.2     2   1        2   0.9     3   1.5   3   1.6     4   0.5   4   0.4      \end{filecontents}     \begin{document}     \begin{tikzpicture}[scale=1]%everything ok     \begin{axis}[     set layers,     xlabel=$x$,ylabel=$y$,legend pos=north west,legend cell align=left]%     \addplot[color=blue,     mark=*,mark layer=like plot]%     table[x=xValue1,y=yValue1] {TableQuestion.txt};%     \addplot[color=red,     mark=none]%     table[x=xValue2,y=yValue2] {TableQuestion.txt};%     \legend{first entry, second entry}     \end{axis}%     \end{tikzpicture}%     \vspace{1cm}     \begin{tikzpicture}[scale=0.8]%everything ok     \begin{axis}[     %set layers,     xlabel=$x$,ylabel=$y$,legend pos=north west,legend cell align=left]%     \addplot[color=blue,     mark=*,mark layer=like plot]%     table[x=xValue1,y=yValue1] {TableQuestion.txt};%     \addplot[color=red,     mark=none]%     table[x=xValue2,y=yValue2] {TableQuestion.txt};%     \legend{first entry, second entry}     \end{axis}%     \end{tikzpicture}%     \vspace{1cm}     \begin{tikzpicture}[scale=0.8]%odd behaviour     \begin{axis}[     set layers,      xlabel=$x$,ylabel=$y$,legend pos=north west,legend cell align=left]%     \addplot[color=blue,     mark=*,mark layer=like plot]%     table[x=xValue1,y=yValue1] {TableQuestion.txt};%     \addplot[color=red,     mark=none]%     table[x=xValue2,y=yValue2] {TableQuestion.txt};%     \legend{first entry, second entry}     \end{axis}%     \end{tikzpicture}%     \end{document}


title: TikZ: How to center captions below figures in matrix

text: I have **three figures** that I want to **align in a matrix**. Each figure is drawn in a different way and needs a caption that is centered below the corresponding figure. Here is what I currently have: ![](http://i.stack.imgur.com/qBjSQ.png) As you can see, the **centering** didn't go too well ;-) The code that produces the above result is:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{positioning}          \begin{document}     \begin{tikzpicture}[grow=right]       \matrix[column sep=1cm] {         \node (R1)  {X};         \node (P1) [right=45pt of R1] {P};         \draw (R1) to (P1);         &         \node {A} child { node {P} } ;         &         \node {X}           child { node {R} }           child { node {R}             child { node {A} }             child { node {A}               child { node {P} }               child { node {P} }               child { node {P} }             }             child { node {A} }           }           child { node {R} }         ;         \\         \node {caption}; & \node {other caption}; & \node {more caption};         \\       };     \end{tikzpicture}     \end{document}      **How can I center the captions in a non-hacky way using TikZ?**   I managed to get the result I need by adding absolute positioning to the labels, but that is a non-sustainable solution.


title: mdframed with label outside of box

text: I am looking to do two boxes with `mdframed` similarly to the following: ![enter image description here](http://i.stack.imgur.com/Pnwsn.png) The first box is easy but I don't know how to place a label to the left of the second box. The positions of the dashed lines are to be fixed: in particular, the position of the second line should NOT depend on the length of the label "(i)". How should I go about doing this? I tried using `\llap` but the label gets cropped. MWE for the first box:               \documentclass{article}          \usepackage[framemethod=TikZ]{mdframed}     \usepackage{lipsum}     \mdfdefinestyle{testframe}{topline=false,rightline=false,bottomline=false,%     innerleftmargin=1em,linecolor=white,%     tikzsetting={draw=black,line width=.5pt,dashed,dash pattern= on 1pt off 3pt} }          \begin{document}          \begin{mdframed}[style=testframe]     \lipsum[3]     \end{mdframed}          \end{document}


title: Convert Markdown + Embedded Latex to PDf and Doc

text: I would like to convert math.stackexchange style plain text markdown with embedded latex equations to PDF and Doc formats. I've tried using pandoc, but keep getting bad PDF's. For example, if I type `pandoc mmn11 -o mmn11.pdf`, I get an output file that looks allot like html when I open it in a text editor and when I try and open it with Document Viewer in Ubuntu, I get an error that it doesn't support plain text. Any ideas what's going on? Edit: Pandoc does the conversion to ODT, but doesn't seem to understand simple latex tags like `\frac`. Some of the latex tags get rendered, but other's don't. I'm pulling my hair out. If I cut and paste the text into cs.stackexchange, everything renders perfectly.


title: Automatically set file name of externalized graphics equal to the file name of the tikz/PGF file

text: As the title says, is it possible to set some options for the externalize library in order to for the filename of the externalized graphics to be equal to the filename of the TikZ-file without using `\tikzsetnextfilename{}` for each and every figure that is to be externalized? E.g. if I have a file `pendulum.tikz`, I'd like the externalized output to get the file name `pendulum.pdf` without having to explicitly specify the name using `\tikzsetnextfilename{pendulum}`. Might be that this is specified in the manual, but then I haven't understood how this is done. Hope someone can help. Edit: an "MWE" (which doesn't work as I want it to) with the TikZ-options I use per today.               \documentclass[12pt]{standalone}          \usepackage{tikz}     \usetikzlibrary{circuits.logic.US,circuits.logic.IEC}     \usetikzlibrary{external}     \tikzexternalize[prefix=figures/]          \begin{document}          \tikzsetnextfilename{circuit}     \begin{tikzpicture}[circuit logic IEC]         \matrix[column sep=7mm]         {             \node (i0) {0}; & & \\             & \node [and gate] (a1) {}; & \\             \node (i1) {0}; & & \node [or gate] (o) {};\\             & \node [nand gate] (a2) {}; & \\             \node (i2) {1}; & & \\         };         \draw (i0.east) -- ++(right:3mm) |- (a1.input 1);         \draw (i1.east) -- ++(right:3mm) |- (a1.input 2);         \draw (i1.east) -- ++(right:3mm) |- (a2.input 1);         \draw (i2.east) -- ++(right:3mm) |- (a2.input 2);         \draw (a1.output) -- ++(right:3mm) |- (o.input 1);         \draw (a2.output) -- ++(right:3mm) |- (o.input 2);         \draw (o.output) -- ++(right:3mm);     \end{tikzpicture}          \end{document}      Edit #2 I have have something like this in my document that I want to externalize               \begin{figure}[ht]         \input{pendulum.tikz}     \end{figure}     \begin{figure}[ht]         \input{circuit.tikz}     \end{figure}     \begin{figure}[ht]         \input{somethingelse.tikz}     \end{figure}      I'd like the externalized graphics to have the filenames `pendulum.pdf`, `circuit.pdf`, and `somethingelse.pdf`, but without having to do it like this:               \begin{figure}[ht]         tikzsetnextfilename{pendulum}         \input{pendulum.tikz}     \end{figure}     \begin{figure}[ht]         \tikzsetnextfilename{circuit}         \input{circuit.tikz}     \end{figure}     \begin{figure}[ht]         \tikzsetnextfilename{somethingelse}         \input{somethingelse.tikz}     \end{figure}


title: Text is going out of bounds; prohibit the hyphenation of all words

text: I have such preamble:               \documentclass[bachelor, subf]{gost732}          \usepackage[a4paper,includefoot,                 left=3.5cm, right=1cm,                 top=2cm, bottom=2cm,                 headsep=1cm, footskip=1cm]{geometry}          \usepackage[T2A]{fontenc}     \usepackage[cp1251]{inputenc}     \usepackage[english]{babel}     \setcounter{tocdepth}{2}     \usepackage{tikz}     \usepackage{tabularx}     \usepackage{graphics}     \usepackage{afterpage}     \usepackage{pscyr}     \usepackage[14pt]{extsizes}     \usepackage[perpage,symbol]{footmisc}     \binoppenalty=10000     \relpenalty=10000          \renewcommand{\thechapterfont}{\normalsize\bfseries}     \renewcommand{\prethechapter}{}      \renewcommand{\postthechapter}{.~}     \renewcommand{\appendixfont}{\normalsize\bfseries}     \renewcommand{\chapterfont}{\normalsize\bfseries}     \renewcommand{\sectionfont}{\normalsize\bfseries}     \renewcommand{\subsectionfont}{\normalsize\bfseries}     \renewcommand{\subsubsectionfont}{\normalsize\bfseries}     \renewcommand{\theappendixalign}{\hfill}     \renewcommand{\theappendix}{\arabic{chapter}}      \renewcommand{\pretheappendix}{\protect{Attachment}~}      \renewcommand{\tocpretheappendix}{\protect{Attachment}~}     \renewcommand{\introname}{Introduction}     \renewcommand{\sectionindent}{1cm}     \renewcommand{\subsectionindent}{1cm}     \renewcommand{\aftersection}{6pt plus .1pt}     \renewcommand{\aftersubsection}{3pt plus .1pt}     \renewcommand{\conclusionname}{Conclusion}     \ifpdf\usepackage{epstopdf}\fi     \def\headfont{\small}     \pagestyle{headcenter}     \chapterpagestyle{empty}     \makeatletter     \renewcommand{\@biblabel}[1]{#1.\hfil}     \makeatother     \hyphenpenalty=10000      Text is going out of bounds. I set the right border to 1 cm, but when I prohibited the hyphenation of all words, the border increased and the text began to go out of bounds: How to fix this problem? Please, help. ![enter image description here](http://i.stack.imgur.com/nZ5Yj.png)


title: cannot scale images with latex fonts which are side by side

text: Referring to cannot use \caption under minipage, When I use the solution provided to the question in link above, in order to include images with latex math fonts embedded into them and place them side by side, the images overlap. For this to happen I use `\input{}` instead of `\includegraphics{}` into my code. The code now looks like this:                 \noindent\begin{minipage}{.5\textwidth}       \centering       \input{fig1.pstex_t}       \captionof{figure}{fig 1}       \label{fig:fig1}                   \end{minipage}%       \begin{minipage}{.5\textwidth}       \centering       \input{fig2.pstex_t}       \captionof{figure}{fig 2}       \label{fig:fig2}                    \end{minipage}      I want to scale them to fit these correctly. Is this possible? if yes, how can I do this? I have tried editing the `.pstex_t` files to scale the images. This does scale the images but the latex fonts get placed incorrectly outside the figure. Using the following does not compile:                   \input[width = .5\textwidth]{}


title: LuaLaTeX: problem with high symbols in math mode

text: A year ago I wrote my thesis and I compiled it using `LuaLaTeX` (I need very much memory because I have a lot of `pgfplots` graphs) and it works pretty good. Today I recompile it and some formulas mess up. The problem is using symbols with a variable height like square roots and brackets. Below there is a MWE showing the problem and then the images of the result compiling with `LuaLaTeX` or `pdfLaTeX`. **MWE**               \documentclass{article}          \begin{document}          \begin{equation}      \hbar\omega_{\pm} = \frac{\hbar q}{2} \sqrt{ \frac{\hbar^2q^2}{m^2} + 2c_1^2 + 2c_2^2 \pm2\sqrt{ {c_1}^4 + {c_2}^4 + 2{c_1}^2{c_2}^2\left(\frac{2{g_{12}}^2}{g_{11}g_{22}}-1\right) } }     \end{equation}          \begin{equation}      \hbar\omega_{\pm} = \frac{\hbar q}{2} \left[ \frac{\hbar^2q^2}{m^2} + 2c_1^2 + 2c_2^2 \pm2\sqrt{ {c_1}^4 + {c_2}^4 + 2{c_1}^2{c_2}^2\left(\frac{2{g_{12}}^2}{g_{11}g_{22}}-1\right) } \right]^{1/2}     \end{equation}          \end{document}      **LuaLaTeX** ![enter image description here](http://i.stack.imgur.com/jf3Ip.png) **pdfLaTeX** ![enter image description here](http://i.stack.imgur.com/CXjFJ.png) The second equation has the same problem with both compilators: the brackets are not high enough compared with the square root. Checking more carefully I see that this problem was present also a year ago. The second problem is instead new and involves only `LuaLaTeX`: I can't nest two square root without obtaining that strange black area.... But the problem disappears if I have no fractions: ![enter image description here](http://i.stack.imgur.com/aEbTt.png) It seems like there is a maximum height of the symbols that can't be overcame


title: How can I label only one line of an equation array?

text: Consider the following commands to create a labelled multi-line equation array:               \begin{eqnarray}     \label{eqn:1}     X&=&Y+Z\\     &\leq & U \times W.          \end{eqnarray}      It creates a two-line equations with two numbers. How can I associate only one equation number to this two-line equations? or better, how can I associated different equation numbers to each line? (of course, without breaking the equation array into several disjoint equations!)


title: Print acronym + full name in brackets at the first occurence of \ac{XYZ}

text: I am using the `acronym` package and have the following problem: In my document, I always want to use `\ac{...}` for my acronyms, so I don't have to care about whether I already mentioned the full name of the acronym or not. `\ac{...}`'s default behavior is that it prints the full name and the acronym in brackets when the acronym is mentioned the first time (Example: `\ac{HTML}` is printed as "HyperText Markup Language (HTML)"). The next time I use it, only the acronym gets printed. This is okay in most cases. But for some acronyms, like "HTML", it would be better to have the acronym first and the full name in brackets, like "HTML (HyperText Markup Language)". I can achieve this if I write `\acs{HTML} (\acl{HTML})`, but then I can't use `\ac{HTML}`, because the next time it will print the full version + acronym in brackets again ;) Is there any way to reverse the full name and the acronym at the first time `\ac{}` is used (or is there an alternative command to achieve this)? I know that it seems to be possible with the `glossaries` package (see here) but the solution provided there is applied to all acronyms, not only to some of them. Also I would like to keep the `acronym` package if possible.


title: MinionPro Number Styles: lining, tabular using pdfLaTeX

text: I have successfully installed the MinionPro font for LaTeX. It works with pdfLaTex. I also changed the number style to lining with:               \usepackage[textlf]{MinionPro}      However if I have a table with numbers, I would like to get numbers in tabular form (monospaced). I'm looking for an option to write in the preamble that applyies at the entire document and works with pdfLaTeX. Thank you very much for some hints! MWE (as requested):               \documentclass[11pt]{scrreprt}     \usepackage[textlf]{MinionPro}     \begin{document}          \figureversion{lf,tab} \begin{table} \begin{tabular}{r|rr}     \bf{-44}    &-2.50  &-1.54  \\      \bf{-31}    &-1.14  &-1.17  \\      \bf{-22}    &-0.77  &-0.80  \\      \bf{-11}    &-0.39  &-0.11  \\      \bf{-0} &-0.01  &-0.04  \\     \bf{0}  &0.00   & 0.04  \\      \end{tabular} \end{table}          \begin{table} \figureversion{lf,tab} \begin{tabular}{r|rr}     \bf{-44}    &-2.50  &-1.54  \\      \bf{-31}    &-1.14  &-1.17  \\      \bf{-22}    &-0.77  &-0.80  \\      \bf{-11}    &-0.39  &-0.11  \\      \bf{-0} &-0.01  &-0.04  \\     \bf{0}  &0.00   & 0.04  \\      \end{tabular} \end{table}          \end{document}      In the first example where the figureversion is out of the table it does not have any influence on the table itself. In the second example, where the figureversion is inside the table it works for the not bold numbers (not for the first column). ![enter image description here](http://i.stack.imgur.com/O0UlV.jpg)


title: font installation on Linux texlive (server) installation

text: I am trying to install the mtpro2 font for texlive2014 following the commands listed http://pctex.com/kb/62.html Everything is working smoothly until the last command: **updmap-sys --enable Map mtpro2.map** which gives me the following error message: **exec: 30: updmap: not found** I am not sure what is the cause of this error. The only posts I could find online regarding such error are fairly old and related with Texlive 2008... I tried to install this font on a Windows PC and another Linux PC and everything worked fine. Would you have any insight or tip regarding this type of error message ? Thanks,


title: \newcommand and name of command

text: I would like to automatically generate commands like               \newcommand{\Air}{\gls{air}}     \newcommand{\Earth}{\gls{earth}}     ...      to use with `glossaries` package, without using `\newcommand` for every entry of the glossary. Is this possible and how? Stating this differently, is it possible to automatically create commands of the type `\Abbr` where `Abbr` is the `uppercase` form of the `abbr` argument in               \newglossaryentry{abbr}{name=...}


title: Colorful Logic Gates using Circuitikz

text: I have to draw following circuit ![enter image description here](http://i.stack.imgur.com/hZAF0.png) the LaTeX source of which is               \documentclass{beamer}     \usepackage{circuitikz}     \begin{document}     \begin{frame}     \begin{figure}     \centering     \begin{circuitikz} \draw     (0,0) node[not port] (not1) {}     (0,2) node[xor port] (xor1) {}     (0,4) node[and port] (and1) {}     (2,3) node[nor port] (nor1) {}     (4,2) node[xor port] (xor2) {}     (6,3) node[or port] (or1) {}     (6,1) node[and port] (and2) {}     (nor1.in 1) node[above](f) {U}     (nor1.in 2) node[below](g) {U}     (xor2.in 1) node[above](h) {U}     (xor2.in 2) node[below](i) {U}     (or1.out) node[right](j) {U}     (and1.out) -- (nor1.in 1)     (xor1.out) -- (nor1.in 2)     (nor1.out) -- (xor2.in 1)     (not1.out) -- (xor2.in 2)     (and1.out) -- (or1.in 1)     (xor2.out) -- (or1.in 2)     (xor1.out) -- (and2.in 1)     (not1.out) -- (and2.in 2);     \end{circuitikz}     \end{figure}     \end{frame}     \end{document}      The circuit looks clumsy. What I want is that the gates whose inputs have been labelled `U` are drawn below the circuit such that the inputs wires of these circuits go downwards and then their outputs go upwards to the respective inputs. The main question which I want to ask (which is also the title) is how to color the input and output wires of these gates red. By these gates I mean the gates whose inputs have been labelled `U`. Will be very thankful even if slight help is offered.


title: Adobe Reader does not open file created with [xetex]{\attachfile2}

text: I have been using `\attachfile2` successfully to create PDF documents with LaTeX already. However, when switching to XeTeX, I find the Adobe Reader says it cannot open the file due to security settings. On clicking the attachment settings, I note the embedded files have no names and no size information. ![enter image description here](http://i.stack.imgur.com/qxY3x.png) I am using LyX to create the PDFXeTeX file.               %% LyX 2.1.0beta1 created this file.       \documentclass[11pt,a4paper,oneside,english,smallheadings]{scrbook}       \usepackage{fontspec}       \setmainfont[Mapping=tex-text,Numbers=OldStyle]{Verdana}       \setsansfont[Mapping=tex-text]{FreeSans}       \setmonofont{cmr10}       \usepackage{fancyhdr}       \pagestyle{fancy}       \setcounter{tocdepth}{0}       \usepackage{color}       \usepackage{float}       \usepackage{setspace}       \setstretch{1.3}       \usepackage[unicode=true,pdfusetitle,        bookmarks=false,        breaklinks=true,pdfborder={0 0 0},backref=section,colorlinks=true]        {hyperref}            \makeatletter            % LyX specific LaTeX commands.       \pdfpageheight\paperheight       \pdfpagewidth\paperwidth                 \@ifundefined{date}{}{\date{}}       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.       \usepackage[xetex]{attachfile2}            \AtBeginDocument{         \def\labelitemiii{\(\triangleright\)}       }            \makeatother            \usepackage{xunicode}       \usepackage{polyglossia}       \setdefaultlanguage{english}       \begin{document}            \title{testing attached files}            \maketitle            \section{Test}            Link see \textattachfile{2_1.png}{this citation}         \end{document}


title: Low quality in tex->dvi->ps->pdf

text: I took a screenshot an then saved as EPS using photoshop. This EPS looks well as it's original source. I use the following code to insert the image:               \begin{figure}[H]\begin{center}      \centering       \captionsetup{justification=centering}       \includegraphics[width=1\textwidth]{pictures/proposal/aaaida_use_case}       \caption{lorem ipsum \label{fig:network-architecture}}     \end{center}\end{figure}      When I compile the tex to dvi, then ps and finally pdf, the resulting image included in the document has a very poor quality, like a JPEG when you save it several times (recompression with quality loss) Instead of this, if I compile directly to dvi and then pdf it shows nice. And if instead of saving to EPS I save the image to PDF, using PDFLatex also looks fine. So I don't understand why the PS step is loosing quality (image recompression). Finally I don't understand pretty well the differences between DVI->PS->PDF and DVI->PDF on terms of the resulting document. Many thanks in advance!


title: Fragile error on robust command using relsize

text: I created a supposedly robust command through `\DeclareRobustCommand{\plusplus}{\relsize{-3}{++}}` that modifies some `++` sign, and I use it in the document. However, when I use the `\relsize` and the `hyperref` package with the `tocdepth` counter set, I obtain a cryptic error (at least for me) > Runaway argument? {\@tempcnta >\z@ \relax \advance \@tempcnta \m@ne > \@tempdimb ! TeX capacity exceeded, sorry [main memory size=10000000]. > ...\@tempcnta \m@ne \@tempdimb \@tempa \@tempdimb \relax l.15 > \subsubsection{test\plusplus} I even try to increase the memory size, as you can see, up to 10000000. And, in my full document the error changes to > Runaway definition? ->\protect 5.3.4 test\protect \<>-\kernel@ifnextchar > [4]\<>-\@ifnextchar \ETC . ! TeX capacity exceeded, sorry [main memory > size=10000000]. \new@ifnex tchar l.108 \subsection{test\plusplus} I don't understand why the error changes. However, the code below is the shortest code I get before removing the error. However, I need to use the `hyperref` package and the table of contents. How can I solve this problem?               \documentclass{book}          \usepackage{relsize}     \DeclareRobustCommand{\plusplus}{\relsize{-3}{++}}          \usepackage{hyperref}%remove hyperref and it compiles          \begin{document}          \setcounter{tocdepth}{3}%or remove teh tocdepth and it compiles     %but use both and it doesn't          \tableofcontents          \subsubsection{test\plusplus}          \end{document}


title: Documentclass for Homework Problems

text: Are there any good documentclasses on CTAN (or built in to some distributions) that are designed for turning in homework problem sets? I've managed to find one, but it's a bit awkward. Are there any others?


title: everything is bold, and pagebreaks are appearing in the wrong place

text: I'm just starting trying to use texmaker 3.3.2. I think I understand the basics but already in a very short document, I have multiple problems. I just downloaded texmaker so I don't think I accidentally changed any defaults or settings. First problem: All the text is bold unless there is other formatting that overrides it, e.g. an enumerated list or table of contents. Second: All of the pagebreaks appear one paragraph before I inserted them. I'm using the default settings of PdfLaTeX + View PDF but I tried some of the others, and it still happens. At first I thought my text might have a sequence of characters causing the bold, but it clearly doesn't, since I replaced it with the dummy text below and it's still happening.               \documentclass[11pt,letterpaper,titlepage]{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \author{Me}     \title{My title}     \begin{document}     \maketitle     \tableofcontents     \section*{Acknowledgements}     \paragraph{I would like to thank my research advisor.}     \paragraph{And some other people. }     \paragraph{This always ends up AFTER the page break, alas.}     \pagebreak     \section*{Abstract}     \paragraph{Most of the abstract.}     \paragraph{One more thing that also appears after a pagebreak.}     \pagebreak     \section{First section}     \end{document}


title: The most basic biblatex example

text: I am looking for the most basic example code for using biblatex. Consider the following bib entries (copied from the answer for this question)               \begin{filecontents}{\jobname.bib}     @book{Labov1972,         Address = {Philadelphia},         Author = {William Labov},         Publisher = {University of Pennsylvania Press},         Title = {Sociolinguistic Patterns},         Year = {1972}}          @book{Chomsky1957,         Address = {The Hague},         Author = {Noam Chomsky},         Publisher = {Mouton},         Title = {Syntactic Structures},         Year = {1957}}     \end{filecontents}      and this code               \documentclass[a4paper,11pt]{article}     \usepackage[style=numeric,backend=biber]{biblatex}     \addbibresource{\jobname.bib}     \begin{document}     As first example citation here is \cite{Chomsky1957}.      Here is another example citation \cite{Labov1972}     \printbibliography     \end{document}      How should I load biblatex (what should I change in the above code) in order to get numeric citation style that would look like: [1] (a number in a square brackets). How different (what exactly to change) in order to get author-year style that would look like Labov (1972). For some reason the list does not print. It is not the main issue here. However, here is an arbitrary option to list the entries (copied from the same answer above). What are the additional minimal required commands to print it? ![enter image description here](http://i.stack.imgur.com/KZTYL.png)


title: URL in new line Bibtex

text: I'm being asked to put the url field in a new line after the reference information. Is there a way to do this using IEEEtran? Edit: Noting the initial suggestions, you can find the idea of the task using the following images: What I would like is the url to be in a new line like this image: ![Objective](http://i.stack.imgur.com/D1fpr.jpg) And I have cases like this one: ![Challenge](http://i.stack.imgur.com/wI4Xl.jpg) Using the field of note instead of url like this: note = {\ \href{http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6315362&isnumber=6314593}{http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=\&arnumber=6315362\&isnumber=6314593}} I have: ![Attempt](http://i.stack.imgur.com/Do2fN.jpg) It looks like what I want but I would still like find a different approach, mainly to replace the comma after the year for a period.


title: Is there a macro which determines whether or not a command will produce printable output?

text: In LaTeX, 'active' declarations (commands without argument) like `\Gamma` produce printable characters to the output stream while 'passive' ones like `\itshape` do not. Is there a macro (or how to write one) which, given a LaTeX declaration as argument, will resolve whether the declaration is active or passive? I need to be able to resolve this issue in order to correctly format the rendering of an input LaTeX argument with embedded declarations.


title: Using commands inside \url?

text: How does one use commands inside \url{..}? MWE:               \documentclass{article}     \usepackage{textcomp}        \usepackage{xcolor}     \usepackage{url}          \newcommand{\placeholder}[1]{\textcolor{red!60!black}{\textlangle#1\textrangle}}          \begin{document}     \url{Hello \placeholder{name}}.     \end{document}      which produces:               Hello \placeholder{name}.      and not the expected:               Hello <name>.      This is a contrived example. In reality I have defined several custom url commands (Macros for formatting & breaking classnames, file paths etc?), and it is in those commands that I want to use the placeholder. But I believe the solution for this simpler case is the same as for the custom urlcommands.


title: Format ToC for thesis

text: I apologize for the unspecified and broad question but I have no way to be specific. I'm looking to generate the TOC and List of Figure, List of Table according to the format required by my school. ![enter image description here](http://i.stack.imgur.com/yRdHc.png) ![enter image description here](http://i.stack.imgur.com/8t1LU.png) I have been trying with `titlesec` but I can't get some details working. Specifically the followings:   * no bold-face;   * The line 'CHAPTER Page' has to appear on every page of the ToC. Same with the line 'Figure Page' for the LoF and 'TABLE Page' for the LoT;   * Single spacing between chapter and its section but double spacing between chapters   * If the title is more than one line long, it should follow the format in Figure 2.1, i.e there are spaces before 1884


title: Problems using listings package

text: I'm using the `listings` package to include some source code files in a LaTeX document. I'm having 2 problems:   1. characters - are not shown in the resulting file   2. characters % are shown overlapped with characters that appear after it. This is my `lstset`:               \lstset{     showstringspaces=false,     extendedchars=true,     frameround=fttt,     frame=single,     upquote=true,     breaklines=true     }      And this is how I insert listings:               \begin{figure}[t]     {\small{     \lstinputlisting[language=Python,numbers=left, numberstyle=\tiny]{modProblem.txt}     \caption{\label{fig:modProblem} El problema del operador \%}     }}     \end{figure}


title: TikZ: adding nodes to a circular diagram from smartdiagram package

text: This is what I would like to achieve: ![enter image description here](http://i.stack.imgur.com/0Knin.png) My MWE is below:               \documentclass{article}     \pagestyle{empty}          \usepackage{lmodern}          \usepackage{smartdiagram}     \usetikzlibrary{shapes.geometric}     \usetikzlibrary{positioning}          \tikzstyle{every picture}+=[remember picture]          \smartdiagramset{%     circular distance=40mm,     font=\normalsize,     text width=20mm,     module minimum width=30mm,     module minimum height=30mm,     module shape=diamond,     arrow tip=to,     %uniform arrow color=true,     arrow color=gray!50!black,     border color=black,     set color list={white,white,white,white,white,white}     }          \tikzstyle{mystyle}=[align=center,fill=white,drop shadow,draw,thick,circle,overlay,minimum width=20mm,text width=25mm]          \begin{document}     ~\vfill     \smartdiagram[circular diagram]{a, b, c, d, e, f}     \tikz \node (a) [mystyle,above=10mm of module1] {Start};      \tikz \node (b) [mystyle,right=10mm of module6] {Finish};     \begin{tikzpicture}[overlay,>=to]     \path[->,gray!50!black,line width=3pt,fill=gray!50!black] (a) edge (module1);     \path[->,gray!50!black,line width=3pt,fill=gray!50!black] (module6) edge (b);     \end{tikzpicture}     \vfill     \end{document}      I would achieve a similar result in a more intuitive way. As you can see I needed to go inside `smartdiagram.sty` to know how the nodes were named, and then I need to use the `overlay`. Moreover, suggestions for start and finish are welcome.