title: How to use table in multicols env. with paragraphs p{} and \multicolumn as well?

text: **updated question** I am going to start all over. Will make the question very simple and direct. Will leave the original question below. I simply want to see an example of using `\multicolumn` in a table (any table env. will do) where the whole env. is typeset in a `multicols`. Here is a MWE               \documentclass[english]{article}     \usepackage{booktabs}% http://ctan.org/pkg/booktabs     \usepackage{multirow}     \usepackage{array}     \usepackage{multicol}     \usepackage{babel}     \usepackage[pangram]{blindtext}     \usepackage{tabularx}          %see similar question asked before     %https://groups.google.com/forum/#!topic/comp.text.tex/66SUHWPeqZY          \begin{document}     \begin{multicols}{2}          \Blindtext[2][3]     \begin{tabularx}{.9\linewidth}{@{}|X|X|@{}}\hline     %\multicolumn{2}{c} \Blindtext[1][3]\\    %%  PROBLEM AREA HERE ******     \Blindtext[1][3]&\Blindtext[1][3]\\\hline     \end{tabularx}          \Blindtext[2][3]          \end{multicols}     \end{document}      If I un-comment the `\multicolumn` above, then the table does not typeset correctly. I need to use `\multicolumn` in the above. What do I need to do? ## old question I'd like to use `\multicols{3}`, where `3` can be changed another value, without having to change the Latex code for setting up table in the code below that. I'd like to use a table (tabular or tabular* or tabularx, whatever works). But use paragraph for columns of the table (or X if it works), since I want to put text that wraps automatically, or use enumeration lists and such, so it has to be paragraph, and I also want to use `\multicolumn` inside the table since I want to span one row over more than one column. I found(*) that tabularx does not work well with `\multicolumn`. I also found if I use `\multicolumn{2}` things do not work, please see second example below. So there are some conflicts, and I am not able to find the correct combination to use. If I use `tabular`, I have to use give explicit size for the column with using `p{2in}` or such. But I do not want to hardcode the width of the columns. Nothing I tried worked. Here are my attempts ## Example 1               \documentclass[12pt,a4paper]{article}     \usepackage{booktabs}% http://ctan.org/pkg/booktabs     \usepackage{multirow}     \usepackage{array}     \usepackage{multicol}     \usepackage{lipsum}     \usepackage{tabularx}          \begin{document}     \begin{multicols}{2}     \noindent           \lipsum[1]          %\begin{tabularx}{.8\textwidth}{@{}|X|X|@{}}     %\begin{tabularx}{.8\linewidth}{@{}|X|X|@{}}     %\begin{tabularx}{\hsize}{|X|X|}     %\begin{tabular*}{\hsize}{|l|p{.8\hsize}}}     %\begin{tabular*}{.8\textwidth}{|l|p{2in}}}     %\begin{tabular}{|p{1in}|p{2in}}     %\begin{tabular*}{.8\linewidth}{|p{.2\linewidth|p{.8\linewidth}}          \begin{tabularx}{.8\linewidth}{@{}|X|X|@{}}     \multicolumn{2}{c} The “lipsum” package is a more basic package.      It generates a certain  “lorem ipsum” text\\     The “lipsum” package is a more basic package. Itlorem ipsum” text&     The “lipsum” package is a more basic package. It generates a      certain number of the standard “lorem ipsum” text     \end{tabularx}     \lipsum[1]     \end{multicols}     \end{document}      ![Mathematica graphics](http://i.stack.imgur.com/57BEP.png) ## Example 2 removing `\multicolumn{2}{c}` seems to have helped.               \documentclass[12pt,a4paper]{article}     \usepackage{booktabs}% http://ctan.org/pkg/booktabs     \usepackage{multirow}     \usepackage{array}     \usepackage{multicol}     \usepackage{lipsum}     \usepackage{tabularx}               \begin{document}     \begin{multicols}{2}     \noindent           \lipsum[1]     %\begin{tabularx}{.8\textwidth}{@{}|X|X|@{}}     %\begin{tabularx}{.8\linewidth}{@{}|X|X|@{}}     %\begin{tabularx}{\hsize}{|X|X|}     %\begin{tabular*}{\hsize}{|l|p{.8\hsize}}}     %\begin{tabular*}{.8\textwidth}{|l|p{2in}}}     %\begin{tabular}{|p{1in}|p{2in}}     %\begin{tabular*}{.8\linewidth}{|p{.2\linewidth|p{.8\linewidth}}     %\begin{tabularx}{\columnwidth}{@{}|X|X|@{}}     \begin{tabularx}{.8\linewidth}{@{}|X|X|@{}}     %\multicolumn{2}{c} The “lipsum” package is a more basic package&     It generates a certain  “lorem ipsum” text\\     The “lipsum” package is a more basic package. Itlorem ipsum” text&     The “lipsum” package is a more basic package. It generates a      certain number of the standard “lorem ipsum” text     \end{tabularx}     \lipsum[1]     \end{multicols}     \end{document}      ![Mathematica graphics](http://i.stack.imgur.com/1QHsL.png) (*) reference https://groups.google.com/forum/#!topic/comp.text.tex/WjdABHwT7-g


title: dmath puts too many line breaks in

text: I've got the following code for an equation:               \begin{dmath}         x \in A - B \leftrightarrow x \in A \textrm{ and } x \not\in B     \end{dmath}      It produces the output: ![enter image description here](http://i.stack.imgur.com/6xLLF.png) The equation really doesn't need so many line breaks, the whole thing could fit on one line. I then put a frame around it to see the bounds of the equation: ![enter image description here](http://i.stack.imgur.com/0xZdv.png) Is there a way to define the bounds of a `dmath` equation so that it isn't crammed into a really small box and given loads of line breaks?


title: Adding a label on a margin (instead of line number) in latex algorithmic package

text: I would like to mark (e.g. with a `*`) a line in a pseudo-code typeset with the `algorithmic` package. I would like the label to appear on the left margin, instead of the line number. Is that possible? I would like to have something like this:                 a = 5       b = 7     * if a < b then         ...       end if


title: How can I fill a complex path with Metapost/Metafun?

text: Is there any way to produce exactly following PS and SVG code with `Metapost`/`Metafun`? Unfortunately, `unfill` won't work for me, as there is a background in the resulting page. And this example is stripped down, as the real path is much more complex. Desired postscript output:               %!PS-Adobe-3.0 EPSF-3.0     %%BoundingBox: 0 0 100 100     %%BeginProlog     %%EndProlog%%Page: 1 1     newpath 0 100 moveto 100 100 lineto 100 0 lineto 0 0 lineto 0 100 lineto closepath             10 90 moveto 10 10 lineto 90 10 lineto 90 90 lineto 10 90 lineto closepath     fill              %%EOF      Desired SVG output:               <?xml version="1.0" encoding="UTF-8" standalone="no"?>     <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="125" height="125">      <g transform="matrix(1.25,0,0,-1.25,0,125)">       <g transform="scale(0.1,0.1)">        <path d="m 0,1000 1000,0 L 1000,0 0,0 0,1000 z m 100,-100 0,-800 800,0 0,800 -800,0" id="3"              style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />       </g>      </g>     </svg>


title: hyperref and cleveref together with enumitem

text: I am working on lecture paper and I am referencing theorem-like environments a lot. I have written down a simple example how my layout might look like:               \documentclass[a4paper]{article}         % references     \usepackage{hyperref}     \usepackage[nameinlink]{cleveref}             % theorem-like environments     \usepackage{amsthm}         % languages     \usepackage[utf8]{inputenc}     \usepackage[czech]{babel}          \usepackage{enumitem}         % new theorem-like environments     \theoremstyle{definition}         \newtheorem{_def}{Definice}[section]                \theoremstyle{plain}         \newtheorem{veta}[_def]{Věta}          \crefname{_def}{D.}{D.}          \begin{document}          \section{First section}          \begin{_def}     \label{sec:def:first}     First definition of this paper.     \end{_def}          \begin{veta}     First theorem with enumerate environment     \begin{enumerate}[label=(\roman*)]         \item Item in the list\label{sec:th:li}         \item Another item in the list     \end{enumerate}     \end{veta}          As you can see in \cref{sec:def:first} and together with \cref{sec:th:li}          \end{document}      The output of the example is this: ![Current result](http://i.stack.imgur.com/w0yZ4.png) **The problem** is the reference to the item in the enumerate environment. I would like the `\cref` to print (the red boxes are not a problem, they aren't there since I wrote this output myself, that is without any referencing): ![Expected result](http://i.stack.imgur.com/oR7xn.png) Thanks! **Additional question** Is there a way of choosing, what form of name should `\cref` choose? For instance I would like to choose between: ![Additional question](http://i.stack.imgur.com/SQwKy.png) **Note A.** I am mixing two languages. Partially for you to understand, but also because I need it to work in my native language. Might seem like not a big deal, but I think that it was `\autoref`, which prints the name e.g. `Definition` which works neatly in English language, but not in my native - because for instance the suffix changes with the context. Might seem like I care too much, but I think it is important. I am referencing theorem in mostly two ways:   * inside a sentence, where using whole word looks, I think, better - especially in mathematical texts, where there is no lack of symbols and abbreviations.   * above `=`,`==>`, etc. symbols in proof, equations,... **Note B.** Sorry for the image quality, I followed the simplest procces: `prt sc` and then cut in `Gimp`.


title: Maths expression in coordinates for a bar chart

text: I am using `pgfplots` to create a bar chart, with the x-axis representing different categories. Using `symbolic x coords` I can specify the labels for the categories. However, I am unable to use a mathematical expression to define the height of the bars (y coordinate). I suspect that this is related to the use of `symbolic x coords`. Here's a minimum (non-)working example:               \documentclass{article}     \usepackage{pgfplots}     \begin{document}          \begin{tikzpicture}         \begin{axis}[symbolic x coords={a,b,c,d,e,f}]             \addplot[ybar] coordinates {                 (a, 1*2)                 (b, 2*2)                 (c, 3*2)                 (d, 4*2)                 (e, 5*2)                 (f, 6*2)             };         \end{axis}     \end{tikzpicture}          \end{document}      The error I receive when compiling with `pdflatex` is: > Package PGF Math Error: Could not parse input ' 1*2' as a floating point > number, sorry. The unreadable part was near '*2'. Any help would be greatly appreciated.


title: How do I create an align environment without space between cells?

text: For example, I would like to create a macro to draw a tableau with letters in the cells. First I create a macro to take in a tabular-like data argument, called `\tableau`, in which I created a `\halign` environment to parse the data and make it into a matrix of cells, in each cell, I used a `\tableaucell` macro to draw the cell. I noticed that `\halign` defaultly create some space between cells, both vertically and horizontally. I managed to eliminate the vertical space by setting the `\lineskip` to `0pt`, but not able to find a way to eliminate the horizontal space too. Here is a simple code to demonstrate my idea.               \documentclass{article}     \usepackage{tikz}          \newcommand\tableau[1]{     \let\\=\cr     \lineskip=0pt     \halign{&\tableaucell{##}\cr#1\cr}     }          \newcommand\tableaucell[1]{     \begin{tikzpicture}     \node at (.5,.5) {\smash{$#1$}};     \draw (0,0)--(0,1)--(1,1)--(1,0)--(0,0);     \end{tikzpicture}     }          \begin{document}     \tableau{a & b \\ c & d & g}     \end{document}      And the result is like: ![The result of the above code.](http://i.stack.imgur.com/c7ru7.png) As you can see there are horizontal space between cells and the vertical space is not really eliminated either. Is there any better solution? The most important thing is that the macro must be able to take a tabular-like data as the argument.


title: tikz viewport/clipping

text: So I'm building a "flipbook animation" using tikz. Where each tikzpicture is a single page, and objects should be _aligned_ across different pages. Now, the problem I'm running into is -- depending on the size / location of border objects, the size of my tikzpicture changes, and as a result, it's placement in the page also changes. Is there someway to tell Tikz the follows: I want you to   * render everything in the rectangular region with x1 <= x <= x2, and y1 <= y2 < y2   * always output a picture of size (x2-x1) x (y2-y1)


title: Conflict between amsmath and pdfcomment

text: I use both `amsmath` and `pdfcomment` in one document. This leads to the references produced by `(\ref{})` to appear like `(zref@1)` instead of numbers like `(1)`. Without `amsmath` or `pdfcomment` this problem does not show up. A minimal (not) working example:               \documentclass{article}     \usepackage{amsmath}     \usepackage{hyperref}      \usepackage{pdfcomment}          \begin{document}          \begin{equation}     \label{eq:1}     E = m \pdftooltip{c}{speed of light}^2     \end{equation}          See eq. (\ref{eq:1}). % <- this produces (zref@1) instead of (1)          \end{document}      Compile it with `pdflatex`. Any suggestions are very welcome.


title: Update matrix entries in beamer

text: I'm trying to show row reducing a matrix in a beamer presentation. I'd like to show successive steps of the row reduction using overlays. The following is close to what I want to do. The problem is that the matrix on the right moves once all of the minus signs disappear from the first column, in overlay 4. I've tried using the methods from section 9.5 of the beamer user guide about "Dynamically Changing Text or Images", but neither `overprint` nor `overlayarea` seem to work correctly in an equation environment. Any tips would be great!               \begin{frame}{Row-echelon form}       Reduce the following matrix to row-echelon form.       \[\begin{bmatrix}         2 & 1 & -1 & 3 \\         1 & -1 & 2 & 1 \\         -4 & 6 & -7 & 1 \\         2 & 0 & 1 & 3       \end{bmatrix}       \onslide<2->       \to       \begin{bmatrix}         1 & -1 & 2 & 1 \\         \alt<2>{2}{0} & \alt<2>{1}{3} & \alt<2>{-1}{-5} & \alt<2>{3}{1} \\         \alt<2-3>{-4}{0} & \alt<2-3>{6}{2} & \alt<2-3>{-7}{1} & \alt<2-3>{1}{5} \\         \alt<2-4>{2}{0} & \alt<2-4>{0}{2} & \alt<2-4>{1}{-3} & \alt<2-4>{3}{1}       \end{bmatrix}\]       \action<5>{}     \end{frame}


title: thmtools: theorem VI.2.1* = dual of theorem VI.2.1

text: I'm writing out a collection of theorems and their proofs corresponding to several theorems that appear without proof (or with only minimal proof sketches) in a published book. I am using thmtools to specify the theorem and proof environments. Of course, it is important that the numbering of the theorems in my write-up matches the numbering of the corresponding theorems in the original text. Many of the theorems in this book come in "dual pairs", and the book uses the typographic convention illustrated by this example: Theorem VI.2.1* is the theorem _dual_ to theorem VI.2.1. Is there some way to define (through thmtools) a "dual theorem" environment that would produce the correct "starred" theorem number for it? Edit: FWIW, here's the definition I'm using for my theorem environment:               \declaretheoremstyle[%       spaceabove=4ex%     ]{thmstyle}     \declaretheorem[%       name={Theorem},%       numberwithin=section,%       style=thmstyle,%     ]{thm}      P.S. it would be insanely cool if this environment could also automatically produce the statement of the dual theorem based on the statement of the original theorem, and even the proof from the original proof, but that would really be pushing the LaTeX envelope... :) Edit2: Here's my attempt to implement egreg's suggestion:               %% the following block is meant to replace egreg's original     %%     \newtheorem*{dualthm*}{Theorem \dualnumber\rlap{*}}     \declaretheorem[%       name={Theorem \dualnumber\rlap{*}},%       style=thmstyle,%   %% see earlier Edit for the definition of thmstyle       unnumbered,%     ]{dualtheorem}          %% `dualthm` below is almost identical to egreg's `dualthm`, except that     %% it refers to `\dualtheorem` instead of `\dualthm*`.     \newenvironment{dualthm}[1]       {\newcommand\dualnumber{\ref{#1}}\begin{dualtheorem}}       {\end{dualtheorem}}      Unfortunately, it fails with:               ! Undefined control sequence.     \thmt@thmname ->Theorem \dualnumber                                         \rlap {*}     l.50 ]{dualtheorem}          ?       I understand (I think) what egreg's scheme is doing, but I don't see how to translate it to thmtools, since, unlike `newtheorem*`, thmtool's `declaretheorem` apparently won't allow a mention of an undefined symbol in its specification. BTW, I tried multiple variants of the above, all of which failed for one reason or another. Then again, I'm a rank n00b at this, so it is very likely that I am missing something obvious. If so, please let me know.


title: Usage of \lastbox

text: As part of our LaTeX3 work, we provide a consistent interface to TeX programming through the expl3 package. We've recently been discussing the TeX primitive `\lastbox`, which is used to inspect or unpack whatever just came before in the typesetting. From a scan over various packages that use `\lastbox`, its use appears to be restricted (entirely, it seems) to constructions like               \setbox\foo=\lastbox     ... % do something with box \foo      That is, there's no need to provide access to the read-only `\lastbox` variable itself, only a method by which the last box can be assigned to a TeX box for further processing; something like               \box_set_to_last:N \foo     ... % do something with box \foo         % no such thing as \lastbox or equivalent      We'd propose to only provide the expl3 programmer with this method and promote that any `\lastbox` related functionality use `\box_set_to_last:N` instead. Does this seem sensible? Contrariwise, do you know of an actual use for `\lastbox` that doesn't involve a `\setbox` first?


title: Different paper orientation in a document lyx

text: I have to change the orientation from portrait to landscape in the middle of a document. Only for 1 until 3 pages after that it have to portrait again. I use this code in texmaker and running well               \newgeometry{landscape}      and use `restoregeometry` to get portrait again But when I try to insert the code in LyX, I don't get an error message but the result is still in portrait. could anyone tell me why? And how to produce landscape pages in the middle a document in LyX?


title: How can I visualize a video (any light format) in a presentation in LaTex?

text: I have tried with this code:               \documentclass[12pt,landscape]{article}     \usepackage{hyperref}     \usepackage{geometry}     \geometry{verbose,letterpaper}      \usepackage{movie15}     \begin{document}     \begin{figure}[H]     \includemovie[poster,text={\small(Loading Circle.mp4)}]{6cm}{6cm}{Circle.mp4}     \end{figure}     \end{document}      It compile well, but when I tried to open the pdf document, I can't see the video correctly because is not installed the correct multimedia player. The error says: > The media requires an additional player. Please click 'Get Media Player' to > download the correct media player. To play the media, you will need to close > and restart the application once the player installation is complete So, I updated my adobe reader to 9.4.7 (last version linux), and still have the same problem. Are there any way to change the default multimedia which is used by Adobe to reproduce videos? Do I need reproduce a specific video format (I tried with .avi, .mp4, .flv, .swf and .mov), or, on the other hand, are there others pdf visualizers or commands which permits to do this task?


title: How can I put real notes in the margin?

text: I'm looking to write a fictional description/discussion by a 'scholar' of an alien race for an RPG, but I can see this being handy elsewhere. I'd like to put his 'notes' in the margins of some text he's found/is writing. I've seen what `\marginpar{margin text}` can do: ![enter image description here](http://i.stack.imgur.com/VODhz.png) but I'm more after this kind of margin note: ![enter image description here](http://i.stack.imgur.com/oudwt.jpg) How could I do that with LaTex?


title: Reducing spaces

text: I have a paragraph in itemize. The paragraph is a long one as as a result it moves to a new line. However, I want to reduce the interline space. I have used \baselineskip but it is making the text too compact. How can i reduce the normal spacing to say 4mm? Please check the exception path thing. ![enter image description here](http://i.stack.imgur.com/RRfrf.png)


title: How to decrease spacing before chapter title?

text: I want to decrease the vertical space between the top of the page and the chapter heading. I have tried to follow the instructions for `titlesec` but I am not successful. I have tried the following two setups without any changes occuring. First:               \documentclass[12pt]{report}       \usepackage[compact]{titlesec}       \begin{document}       \chapter{Characters}          The origin of the group determinant begins with Richard Dedekind in the late 1800's. He began to explore the idea after studying the discriminant in a normal field [A]. He made several observations about the group determinant, but was only able to prove some of them.           \end{document}      Second:               \documentclass[12pt]{report}       \usepackage{titlesec}       \titleformat{\chapter}[display]       {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}       \titlespacing{\chapter}{0pt}{0pt}{0pt}       \begin{document}       \chapter{Characters}            The origin of the group determinant begins with Richard Dedekind in the late 1800's. He began to explore the idea after studying the discriminant in a normal field [A]. He made several observations about the group determinant, but was only able to prove some of them.           \end{document}


title: Increasing the height of the Beamer footline

text: When I add a `tabular`environment to the `footline` of my presentation, only the first line is shown. How can I increase the heigth of the footline to show the whole table? ![example](http://i.stack.imgur.com/b5S2a.png)               \documentclass[12pt,ngerman]{beamer}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \setbeamertemplate{navigation symbols}{}          \begin{document}          \setbeamertemplate{footline}{     {     \tiny\begin{tabular}{p{0.25\textwidth}p{0.25\textwidth}p{0.45\textwidth}}     First line & John Doe & fsdfs\\      second line \& Title of the talk & dsdfsd\\     some third line & &      \end{tabular}     }}          \frame{     \frametitle{fdfsdgdf}          \begin{itemize}     \item      \item      \item      \end{itemize}     }          \end{document}


title: \textbf has wider space than \bf with own command

text: How come the `\textbf` command results in a wider space between words, than the deprecated `\bf` when using this own command?               \documentclass{article}     \usepackage{hyperref}     \begin{document}             \makeatletter             \newcommand*{\textlabel}[2]{                 \edef\@currentlabel{#1}                 \phantomsection                 #1\label{#2}             }         \makeatother          \begin{description}         \item[item] \textbf{\textlabel{First text}{ref1}} \\         Description!         \item[item] {\bf \textlabel{Second text}{ref2}} \\         Description!     \end{description}     \end{document}      Output: ![enter image description here](http://i.stack.imgur.com/1Z65l.png)


title: TikZ: drawing an evolution of an ellipse to a hyperbola with the same focus

text: Is there a high speed way to draw the evolution of an ellipse, to a parabola, and then into a few hyperbolas with the same focus? ![enter image description here](http://i.stack.imgur.com/jRELh.png) From the picture, we see that we start out with three elliptical orbits around Earth all with Earth being the focus. The ellipse progress from no intersection with the moons orbit, to a Hohmann transfer ellipse, and then an ellipse with to intersections. After the ellipse evolution, the next orbit is parabolic and then it finishes with three hyperbolic orbits. I could draw all these individually, but I believe there could be a way to do this without such a tedious method.               \documentclass[convert = false, tikz]{standalone}          %\usepackage{fp}                                                                         %\usetikzlibrary{fixedpointarithmetic}                              %\usetikzlibrary{calc}     %\usetikzlibrary{intersections}                                                           \begin{document}     \begin{tikzpicture}       \coordinate (E) at (0, 0);            \def\moonrad{4cm}            \draw (E) [partial circle = -15:150:\moonrad];       \shadedraw[gray, left color = orange!75!blue, right color = blue!75!black]       (E) circle[radius = .3cm];     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/uMBDZ.png) * * * Using percusse idea, I have constructed the ellipse, parabola, and hyperbolas. Unfortunately, I am not sure how I can shift them in the `\foreach` command to place them all at `(0, -.5)`.                 \coordinate (E) at (0, 0);            \def\moonrad{4cm}       \def\dom{3}            \draw (E) [partial circle = -15:150:\moonrad];       \shadedraw[gray, left color = orange!75!blue, right color = blue!75!black]       (E) circle[radius = .2cm];            \foreach \a/\b/\type in {.75/1/dashed, 1.25/2.25/dotted, 1.5/3/}{         \draw[\type] (0, -.5) arc[x radius = \a, y radius = \b, start angle =-90,         end angle = 270];       }            \begin{scope}[shift = {(0, -.5)}]         \draw plot[domain = 0:\dom, samples = 500] ({\x}, {.5 * (\x)^2});       \end{scope}            \foreach \a/\angle in {1.5/30, 2/45, 3/60}{         \pgfmathsetmacro{\b}{\a / tan(\angle)}         \draw plot[domain = 0:\dom, samples = 500]         ({\x}, {\a * sqrt(1 + (\x / \b)^2)});       }      ![enter image description here](http://i.stack.imgur.com/TW1x8.png)


title: Turnstile package

text: I am fairly new to TeX, so I may be missing something simple, but I can't seem to adjust the height of the turnstile objects produced by the `turnstile` package. In particular, if the symbol appears as a subscript it does _not_ adjust to match the surrounding text. Does anyone know of a solution?


title: Want a TeX to XML or MathML converter

text: Is there a TeX engine that converts a TeX document to MathML or XML directly the way PDFTeX converts text input to PDF? I am familiar with some converters that transform a _subset_ of TeX into something that can be viewed on a browser, but they all leave out many of the packages I used, particularly `hyperref` and `xypic`. I want a converter that passes Knuth's test for genuine TeX.


title: Splitting the preamble

text: When working with big documents, especially when dealing with many lists, graphics, figures and includes, I often come up with a structure roughly looking like this.               \documentclass{beamer}          [preamble for part 1]     [preamble for part 2]     [preamble for part 3]     ....          \begin{document}     [part 1 body]     [part 2 body]     [part 3 body]     ...     \end{document}      A usual practise is to export the body parts to single files and then `\include` them. The `subfiles` package provides a more comfortable approach by making it possible to compiled the parts independently reusing the preamble of the main file. But `subfiles` discards the preambles of the subfiles. To make it possible to both modularize preamble and body, each body part must be exported to a subfile `part1.tex` and each preamble part to a corresponding package `part1.sty`. The document is then stitched together using `\include` and `\usepackage`. Ideally, preamble and body of the parts should be kept together. Compiling individual pdfs then to connect with `\includepdf` comes somewhat close to this, but is hard to use especially with `beamer` when the whole document should be produced in handout mode or with notes. Dealing with overlays or providing a correct table of contents is even more cumbersome. How I really would like to structure the document is along the lines of this.               %main.tex     \documentclass{beamer}     \include{part1}     \include{part2}     ....               %part1.tex     \documentclass{beamer}     [part 1 preamble]     \begin{document}     [part 1 body]     \end{document}               %part2.tex     \documentclass{beamer}     [part 2 preamble]     \begin{document}     [part 2 body]     \end{document}      Is it possible to realize this scheme? Could it even be possible to realize it and be able to compile the parts independently?


title: Placement of showkeys label

text: Is it possible to place the labels of the showkeys package for bibliographic items on the right side instead of the default left? I tried               \patchcmd{\SK@@label}{\llap}{\rlap}{}{}      which indeed changes the location of the label but not very satisfying. MWE:               \documentclass{article}     \usepackage{showkeys}     \begin{document}     \begin{enumerate}     \item \label{test} test     \item \label{test2} test2     \end{enumerate}     \end{document}


title: Suppressing the frametitle in mdframed tikz frames

text: I really like the digression style created in mdframed digressionarrows style with custom header. I would like to extend it even further by displaying the `frametitle` (if it is defined) after the custom `digressiontitle` (i.e. Side note or Info). So far this is what I managed to do:                   \documentclass{article}              \usepackage{tikz}            \usetikzlibrary{calc,arrows}         \usepackage{etoolbox}              \usepackage[framemethod=tikz]{mdframed}         \makeatletter         \mdf@do@stringoption{digressiontitle=={Digression}}         \tikzset{           excursus arrow/.style={%                line width=2pt,               draw=gray!40,               rounded corners=2ex,               },            excursus head/.style={               fill=white,               font=\bfseries\sffamily,               text=gray!80,               anchor=base west,           },         }         \mdfdefinestyle{digressionarrows}{%            singleextra={%                     \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);                     \path let \p1=(Q), \p2=(O) in (\x1,{(\y1-\y2)/2}) coordinate (M);                     \path [excursus arrow, round cap-to]                                 ($(O)+(5em,0ex)$) -| (M) |- %                                 ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. %                                 ++(23em,2ex);                     \ifx\empty\mdf@frametitle\empty                        \node [excursus head] at ($(Q)+(2.5em,-0.75pt)$) {\mdf@digressiontitle};                     \else                        \node [excursus head] at ($(Q)+(2.5em,-0.75pt)$) {\mdf@digressiontitle:\space\mdf@frametitle};                     \fi},            firstextra={%                     \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);                     \path [excursus arrow,-to] (O) |- %                                 ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. %                                 ++(23em,2ex);                     \ifx\empty\mdf@frametitle\empty                        \node [excursus head] at ($(Q)+(2.5em,-0.75pt)$) {\mdf@digressiontitle};                     \else                        \node [excursus head] at ($(Q)+(2.5em,-0.75pt)$) {\mdf@digressiontitle:\space\mdf@frametitle};                     \fi},            secondextra={%                     \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);                     \path [excursus arrow,round cap-]($(O)+(5em,0ex)$) -| (Q);},            middleextra={%                     \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);                     \path [excursus arrow](O) -- (Q);},            middlelinewidth=2.5em,middlelinecolor=white,            hidealllines=true,topline=true,            innertopmargin=0.5ex,            innerbottommargin=2.5ex,            innerrightmargin=2pt,            innerleftmargin=2ex,            skipabove=0.87\baselineskip,            skipbelow=0.62\baselineskip,         }         \makeatother              \newmdenv[style=digressionarrows,digressiontitle=Info]{info}         \newmdenv[style=digressionarrows,digressiontitle=Side note]{sidenote}              \usepackage{lipsum}              \begin{document}              \begin{sidenote}[frametitle=A side note 1]         \lipsum[3]         \end{sidenote}              \begin{info}[frametitle=My frame]         \lipsum[1]         \lipsum         \end{info}              \end{document}      The problem with this solution is that the `frametitle` is still being displayed. Is there an easy way to suppress the display of `frametitle` by `mdframed`? **Update:** Here is the picture which hopefully illustrates the problem: ![Image showing duplicate title](http://i.stack.imgur.com/1O9Vp.png) As you can see, "A side note 1" appears twice, once in gray after Side note:, which should be kept, and once inside the frame above the text. This I want to suppress.


title: LaTex Error message: !Missing \endcsname inserted

text: I'm getting this error message when compliling my .tex file: > ! Missing \endcsname inserted. \relax l.34 ... Preamble of my code is following:               \documentclass [a4paper,11pt,twocolumn] {article}     \usepackage[left=2cm,text={17cm, 24cm},top=2.5cm]{geometry}     \usepackage[utf8]{inputenc}     \usepackage[czech]{babel}     \usepackage[IL2]{fontenc}     \usepackage{times}     \usepackage{url}      Could anyone please tell me, what might cause this error?


title: Strange Chapter Style in Hoefler Text

text: Does anyone know why the bibliography appears as in the picture when using Hoefler Text (and how to fix it)? ![enter image description here](http://i.stack.imgur.com/5QD8R.png) Here's a minimal working example:               \documentclass[11pt, a4paper]{article}     \usepackage{fontspec}     \setmainfont[Mapping=tex-text]{Hoefler Text}          \begin{document}         \section{References}     \end{document}      Addendum: Let's ask this differently. Suppose I wanted to specify which font XeLaTeX should use for bold faces. Which command should I use?


title: Natbib Article format: Omit volume and pages

text: How can I omit the volume number and page numbers from the citations in the footnotes of the following MWE Beamer example?               \documentclass{beamer}     \usetheme{Boadilla}          \begingroup\newif\ifmy     \IfFileExists{\jobname.bib}{}{\mytrue}     \ifmy     \begin{filecontents}{delete.bib}     @ARTICLE{Brav2002,         author = {Alon Brav and J. B. Heaton},         title = {Competing Theories of Financial Anomalies},         journal = {Reveiw of Financial Studies},         year = {2002},         volume = {15:2},         pages = {575-606},         owner = {User},         timestamp = {2013.11.03}     }     \end{filecontents}     \fi\endgroup          \usepackage{natbib}     \usepackage{bibentry}     \bibliographystyle{elsart-harv}     \usepackage{chngcntr}     \usepackage{lmodern}          \setbeamercolor{palette primary}{fg=black, bg=black!10}     \setbeamercolor{palette secondary}{fg=black, bg=black!15}     \setbeamercolor*{palette tertiary}{fg=black,bg=black!10}      \setbeamercolor*{palette quaternary}{fg=black,bg=black!10}          \newcommand\footcite[1]{\protect\footnote{\bibentry{#1}}}           \begin{document}     \nobibliography{\jobname}     \begin{frame}         \frametitle{Stuff famous linguists asked}         \begin{block}{A block}         \begin{enumerate}         \item Is it part?\footcite{Brav2002}         \item More Saussure         \end{enumerate}         \end{block}     \end{frame}     \end{document}


title: How to catch missing font error and use another font?

text: I write a TeX-document on two PCs, the files are transferred via USB-Stick. The document should be printed with a specific font. For legal reaons the font is only available on one PC. When I translate the document in the PC without the font, I get a _fontspec error: "font-not-found"_. (same error in another question) The finished document shows no characters. Is there a mechanism to detect this problem and switch to another font? Actually I change my font selection each time I change the computer. But I want to avoid to use two versions of my style. I would like to have one style for each computer. A MWE:               \documentclass{article}     \usepackage{fontspec}     %This throws an error - I want to catch it and use another font     \setmainfont{My Font on other PC}      %If error:     %\setmainfont{Arial}      \begin{document}     Test     \end{document}      My wish: This document will be translated without an error with lualatex on a windows PC. If the font _My Font on other PC_ is installed, it is used. If it is not installed, the alternative should be used.


title: How to add multiple images in one place using captions like Figure x. a, Figure x.b?

text: Is it possible to **caption** the two figures as Figure x.a, Figure x.b?


title: Paths and Linux/Windows slash conventions

text: I'm working on a collaborative project and I like to organize all the supporting files for my tex documents (rather than just having everything in one flat folder). This involves referencing figures/files/etc. by a (relative) path. The difference in slash convention between linux/windows means that collaboration between users on different systems becomes annoying. Is there any easy way of dealing with path references between systems?


title: How to print a LaTeX matrix using xtable in R

text: I'm trying to get R to print a matrix as a LaTeX matrix using `xtable`, using the LaTeX environment `bmatrix`.               a <- matrix(rnorm(25), 5 ,5)     x <- xtable(x)     > print(x, floating=FALSE, tabular.environment="bmatrix", hline.after=NULL, include.rownames=FALSE, include.colnames=FALSE)      I get this:               % latex table generated in R 2.14.1 by xtable 1.6-0 package     % Fri May 11 08:16:12 2012     \begin{bmatrix}{rrrrr}       0.70 & 1.30 & -0.44 & 0.97 & -0.86 \\        -1.23 & -0.59 & 0.04 & -0.32 & 0.12 \\        -0.64 & -0.19 & 0.11 & 0.77 & 0.05 \\        0.56 & -0.28 & -2.05 & 1.01 & -1.77 \\        0.02 & -1.24 & 0.51 & -0.49 & 1.23 \\      \end{bmatrix}      Is there a way to suppress the `{rrrrr}` alignment attribute, or otherwise get xtable to produce a bracketed matrix that I can use in a math environment?


title: Removing additional middle name with biblatex

text: i'm using biblatex with apa style. I have some authors that have too many middle names. It give me something like this : > Licht, C. M. M., de Geus, E. J. C., van Dyck, R., & Penninx, B. W. J. H. > (2009). Association be- tween anxiety disorders and heart rate variability > in The Netherlands Study of Depression and Anxiety (NESDA). Psychosomatic > medicine, 71(5), 508–518 instead I would like to have something like this with a maximum of two middle name : > Licht, C. M., de Geus, E. J., van Dyck, R., & Penninx, B. W. (2009). etc... I can't find any nice way of doing that (without deleting the additional names from my bib entry). Hope you can help me. This is the MWE :               \documentclass{article}     \usepackage{filecontents}          \begin{filecontents*}{demo.bib}     @article{Licht2009,     abstract = {},     author = {Licht, Carmilla M M and de Geus, Eco J C and van Dyck, Richard and Penninx, Brenda W J H},     doi = {10.1097/PSY.0b013e3181a292a6},     issn = {1534-7796},     journal = {Psychosomatic medicine},     number = {5},     pages = {508--518},     pmid = {19414616},     title = {{Association between anxiety disorders and heart rate variability in The Netherlands Study of Depression and Anxiety (NESDA).}},     url = {http://www.ncbi.nlm.nih.gov/pubmed/19414616},     volume = {71},     year = {2009}     }     \end{filecontents*}          \usepackage[backend=biber,style=apa,citestyle=authoryear,natbib=true,uniquelist=minyear,doi=false]{biblatex}     \bibliography{demo}          \begin{document}         A reference to : \cite{Licht2009}          \printbibliography     \end{document}      Thanks. br.


title: Bold italic math with unicode-math

text: How can I get the output I get without `unicode-math` using `unicode-math`, _preferably_ (not necessarily) using the same code (`\boldmath`)? I would like the solution to work with at least the XITS and Latin Modern fonts, both of which have no build-in bold math font.. edit: I can see attention is fading away. Of course it is not possible to make non-bold fonts 'truly bold', but the output Word produces when you make formulae bold is acceptable, and Cambria Math also doesn't have a bold font. You can even make XITS and Latin Modern bold in math just by pressing CTRL+B. I accept any answer that makes LaTeX behave like Word in this. Without `unicode-math`               \documentclass{article}     \begin{document}       This should be entirely bold: {\boldmath$O(\log n)$} \\       This should not be bold: $O(\log n)$     \end{document}      I get nice-looking output: ![Output without unicode-math](http://i.stack.imgur.com/QlpJb.png). With `unicode-math`, the code               \documentclass{article}     \usepackage{unicode-math}     \setmainfont{XITS}     \setmathfont{XITS Math}     \begin{document}     This should be entirely bold: {\boldmath$O(\log n)$} \\     This should not be bold: $O(\log n)$     \end{document}      gives ![With unicode-math 1](http://i.stack.imgur.com/SMFb9.png). I already tried a bunch of things, for example the following code.               \documentclass{article}     \usepackage{unicode-math}     \setmainfont{XITS}     \setmathfont{XITS Math}     \setmathfont[range=\mathup/{greek,Greek,latin,Latin,num}]{XITS}     \setmathfont[range=\mathit/{greek,Greek,latin,Latin,num}]{XITS Italic}     \setmathfont[range=\mathbfup/{greek,Greek,latin,Latin,num}]{XITS Bold}     \setmathfont[range=\mathbfit/{greek,Greek,latin,Latin,num}]{XITS Bold Italic}     \begin{document}     This should be entirely bold: {\boldmath$O(\log n)$} \\     This should not be bold: $O(\log n)$     \end{document}      Which unfortunately gives me this: ![With unicode-math 2](http://i.stack.imgur.com/xLaIl.png). Word output looks like this: ![enter image description here](http://i.stack.imgur.com/n7PUJ.png).


title: problem with mathdesign-font and texnansi.enc

text: I have a problem with the font bitstream-charter. > less dummy.tex               \documentclass[a4paper,10pt]{scrbook}     \usepackage[bitstream-charter]{mathdesign} %my font!     % \usepackage[sfdefault]{cabin}     \usepackage[T1]{fontenc}          \begin{document}      aaaaaa     \end{document}      pdfLatex fails to produce a PDF with the following error:               pdflatex dummy.tex      This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)      restricted \write18 enabled.     entering extended mode     (./dummy.tex     LaTeX2e <2014/05/01>     Babel <3.9k> and hyphenation patterns for 34 languages loaded.     (/usr/local/texlive/2014/texmf-dist/tex/latex/koma-script/scrbook.cls     Document Class: scrbook 2013/12/19 v3.12 KOMA-Script document class (book)     (/usr/local/texlive/2014/texmf-dist/tex/latex/koma-script/scrkbase.sty     (/usr/local/texlive/2014/texmf-dist/tex/latex/koma-script/scrbase.sty     (/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/keyval.sty)     (/usr/local/texlive/2014/texmf-dist/tex/latex/koma-script/scrlfile.sty     Package scrlfile, 2013/12/19 v3.12 KOMA-Script package (loading files)                       Copyright (C) Markus Kohm          ))) (/usr/local/texlive/2014/texmf-dist/tex/latex/koma-script/tocbasic.sty)     (/usr/local/texlive/2014/texmf-dist/tex/latex/koma-script/scrsize10pt.clo)     (/usr/local/texlive/2014/texmf-dist/tex/latex/koma-script/typearea.sty     Package typearea, 2013/12/19 v3.12 KOMA-Script package (type area)                       Copyright (C) Frank Neukam, 1992-1994                       Copyright (C) Markus Kohm, 1994-          )) (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mathdesign.sty     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/ifthen.sty)     (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mdbch/mdbch.cfg)     (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mdbch/mdbch.sty     (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mdfont.def)     (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mdsffont.def)     (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mdttfont.def)     (/usr/local/texlive/2014/texmf-dist/tex/latex/xkeyval/xkeyval.sty     (/usr/local/texlive/2014/texmf-dist/tex/generic/xkeyval/xkeyval.tex     (/usr/local/texlive/2014/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))     (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mdbch/ot1mdbch.fd))     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/fontenc.sty     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/t1enc.def)     (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mdbch/t1mdbch.fd)))     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/fontenc.sty     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/t1enc.def)) (./dummy.aux)     (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mdacmr.fd)     (/usr/local/texlive/2014/texmf-dist/tex/latex/mathdesign/mdbcmr.fd) [1{/usr/loc     al/texlive/2014/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./dummy.aux) )     !pdfTeX error: pdflatex (file texnansi.enc): cannot open encoding file for read     ing      ==> Fatal error occurred, no output PDF file produced!      Any idea what the problem might be?   * all necessary packages are installed!   * other fonts work nicely (tested `\usepackage[sfdefault]{cabin}`)   * using Ubuntu 14.04


title: Wrong line break in description environment after a long label

text: I encountered an issue with my description environments: If I use a label that almost is as long as the text width, the explanatory text afterwards is not wrapped correctly. I am using the `mdwlist` package with the `description*` environment, but the problem is reproducible also with the normal `description` environment (see example below). Searching for similar problems did not help me so far, because most topics deal with labels that are longer than the text width, which can be treated with the `\desclabelwidth` command of `mdwlist`. What I found so far is that there is the command `\desclabelwidth` to control the width of the label, and `\labelsep` to control the width of the separator after the label. Now I think my problem is that the text in the first line after the label is longer than `\textwidth` - `\desclabelwith` - `\labelsep`. Is there any way to control this width, or do you know any other way to circumvent the problem? EDIT: I found my problem has to do with my BCOR settings - I set the value to 15mm, then the problem occurs also with short words. Many thanks! Here my minimal working example - the word "text" does not fit into the line and in my opinion could as well go into the next one. Instead, I get this warning: > Overfull \hbox (12.03125pt too wide) in paragraph at lines 9--10               \documentclass[BCOR=15mm]{scrbook}          \begin{document}            \chapter{Issues with descriptions}            \begin{description}         \item[A normal label.] A text with short words, nicely wrapped. One two three four five six seven eight nine ten.         \item[A very long label that is almost as long as the text width, but not quiet.] A text with short words, not so nicely wrapped. One two three four five six seven eight nine ten.       \end{description}          \end{document}      ![Output of the code shown below](http://i.stack.imgur.com/k6uG4.png)


title: Centering full-page tikz images - with mid-document paper size change

text: I just got this question answered: xetex - Centering full-page Tikz image on page without margins with xelatex? - TeX - LaTeX ... and all works there. However, here is my problem - I basically have a document whose normal pages are A4, whereas these SVG->tikz images are supposed to be A5. So, I try to:   * define the document as A4;   * use the trick from Change paper size in mid-document with setting `\pdfpagewidth`/`height`; to switch the necessary pages to A5 ... however, but that seems to mess up the page calculation Tikz uses. Here is a MWE (same as in first link, changed so it includes the tikz image instead): **test.tex**               \documentclass[12pt,a4paper]{article}          \usepackage[pass]{geometry}     %   %\usepackage{hyperref}     \usepackage{tikz}               \begin{document}          % \thispagestyle{empty}     \pdfpagewidth=148mm \pdfpageheight=210mm          \input{testin.tex}          \end{document}      **testin.tex**               \definecolor{cff0000}{RGB}{255,0,0}          \begin{tikzpicture}[overlay,remember picture,anchor=north west,inner sep=0pt, outer sep=0pt]          \node at (current page.north west) {%            \begin{tikzpicture}[overlay,remember picture,y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt,anchor=north west]              \begin{scope}[shift={(0,0.34461553)}]% layer1                % rect3016           \path[color=black,fill=cff0000,line width=0.800pt,rounded corners=0.0000cm]             (0.0000,-0.3446) rectangle (524.4094,743.7499);              \end{scope}            \end{tikzpicture}          };          \end{tikzpicture}      Here is a little experiment with these files I did; when it says (clear state), means I've removed the `.aux` beforehand:   1. With `\documentclass[12pt,a5paper]{article}`; without `\pdfpagewidth`/`height` setting      1. xelatex first pass (clear state), .aux:                           \relax         \pgfsyspdfmark {pgfid2}{5924114}{69025514}         \pgfsyspdfmark {pgfid1}{5891346}{29900006}     2. xelatex second pass, (page OK), .aux:                           \relax         \pgfsyspdfmark {pgfid2}{32768}{39125508}         \pgfsyspdfmark {pgfid1}{5891346}{29900006}    2. With `\documentclass[12pt,a4paper]{article}`; without `\pdfpagewidth`/`height` setting      1. xelatex first pass (clear state), .aux:                           \relax         \pgfsyspdfmark {pgfid2}{7955730}{101470942}         \pgfsyspdfmark {pgfid1}{7922962}{46122720}     2. xelatex second pass, (img aligned, but page is bigger; as expected), .aux:                           \relax         \pgfsyspdfmark {pgfid2}{32768}{55348222}         \pgfsyspdfmark {pgfid1}{7922962}{46122720}   3. With `\documentclass[12pt,a4paper]{article}`; WITH `\pdfpagewidth`/`height` setting; no clear state      1. xelatex first pass (continued from previous a4paper - page is OK!), .aux:                           \relax         \pgfsyspdfmark {pgfid2}{32768}{39125508}         \pgfsyspdfmark {pgfid1}{7922962}{29900006}     2. xelatex second pass (image goes out of page), .aux:                           \relax         \pgfsyspdfmark {pgfid2}{32768}{55348222}         \pgfsyspdfmark {pgfid1}{7922962}{29900006}   4. With `\documentclass[12pt,a4paper]{article}`; WITH `\pdfpagewidth`/`height` setting      1. xelatex first pass (clear state; first pass img not even visible), .aux:                           \relax         \pgfsyspdfmark {pgfid2}{7955730}{85248228}         \pgfsyspdfmark {pgfid1}{7922962}{29900006}     2. xelatex second pass (image goes out of page), .aux:                           \relax         \pgfsyspdfmark {pgfid2}{32768}{55348222}         \pgfsyspdfmark {pgfid1}{7922962}{29900006} The only thing I can conclude from this experiment, is that the page is OK, when the .aux file (after the xelatex run) contains:               \relax     \pgfsyspdfmark {pgfid2}{32768}{39125508}     \pgfsyspdfmark {pgfid1}{7922962}{29900006}      ... so apparently, it is possible to position the image correctly, _even_ if documentclass is A4 page, and I switch "manually" to A5 using `\pdfpagewidth`/`height`; just don't know how to do this correctly `:)` So, is there a way to write the .tex, so I can position the A5 tikz box all over the page, which is manually switched to A5 ? (NB: I'd like to keep all this as tikz/latex code, I'm not too keen on exporting individual PDFs and including them with say `pdfpages` or the like). Many thanks in advance for any answers,   Cheers!


title: How to do basic math with FIGURE counter in PDF bookmarks

text: I'm preparing a document (`revtex4-1` class) with figures. I'd like to have bookmark for each figure in the PDF, so I use `hyperref` with the following command that inserts figures:               \newcommand{\AddFigureLabelContentCaption}[3]{{     \clearpage     \begin{figure}[t]     \currentpdfbookmark{Figure \arabic{figure}}{name:#1}     {#2}     \caption{#3}     \label{#1}     %\currentpdfbookmark{Figure \thefigure~[++]}{name:#1}     \end{figure}     }}      Everything is OK, but figure numbers start from zero. When I move the `\currentpdfbookmark` command after the `label` command, figure numbers in PDF bookmarks are OK. But clicking on the bookmark sends me right after the figure, which is not good. Is it possible to output not the `figure` counter, but `figure+1`? I do not want to mess the `figure` counter, I just want to output a `figure+1`.


title: How to change some items in bibliography

text: I'm using `natbib` package and `jtbnew` bibliography style. I would like to ask you some questions.   1. How can I change output and instead of abbreviation _ed._ get _edition_?   2. How can I change output and instead of abbreviation _vol_. get _volume_?   3. How can I write the author name _Øksendal_?


title: How to extend the footer to include the margin notes

text: My `memoir` document has a relatively narrow typeblock (90mm) and a wide margin (55mm) for annotations, with a `\marginparsep` of 15mm.   I want the footer to cover both the typeblock and the annotation block, so it should be 90+15+55=160mm wide.   When I try to do this with `\makerunningwidth`, the footer is extended in both margins:               \documentclass[twoside,a4paper,article]{memoir}     \usepackage{kantlipsum}     \setlrmarginsandblock{30mm}{90mm}{*}     \setmarginnotes{15mm}{55mm}{\onelineskip}     \checkandfixthelayout[nearest]     \typeoutlayout     \makepagestyle{test}     \makerunningwidth{test}{160mm} % typeblock + \marginparsep + \marginparwidth     \makeevenfoot{test}{\thepage}{}{spine}     \makeoddfoot{test}{edge}{}{\thepage}     \pagestyle{test}          \begin{document}     \section{Section heading}     Hello. \marginpar{\kant[40]}\kant[1-5]     \end{document}      How can I extend the footer only in the direction of the edge, leaving the spine margin untouched?


title: Align multi-line section head on the grid

text: **What I want to achieve** Align the first line of a multi-line section head on the grid and consecutive lines according to the baseline distance given in the font definition. The baseline distance of the font used for the section heads does not match the grid distance. **What I have so far** If a section head consists of only one line, then `grid=high` does what I expect; the first (in fact, the only line) is aligned on the grid. However, when the head consists of more than one line, the last line is always aligned on the grid, instead of the first. **Available documentation** The Details manual lists several values for `grid` and quite some documentation. But all examples are single-line heads, unfortunately. **The code**               \setuplayout [grid=yes]     \definefont  [BigFont]  [Bold at 20pt] [24pt]     \setuphead   [section]  [style=\BigFont, grid=high, before={\blank[4*line]}]          \showgrid     \starttext            \startsection [title=Lorem ipsum dolor]         \input ward       \stopsection            \startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing elit]         \input ward       \stopsection            % Demonstration what I'd like to achieve       \blank [4*line]       \startlinecorrection         \BigFont\raisebox5pt\vbox\bgroup           3 Lorem ipsum dolor sit amet consectetur\crlf           \null\kern20pt adipisicing elit\egroup       \stoplinecorrection       \input ward          \stoptext      ![screenshot](http://i.stack.imgur.com/hUCxy.png) The first single-line head is fine. The second is the wrong multi-line head that wants to be corrected; and the third one is a hack to show how it should look like.


title: Is there a way to move all footnotes to the end of the document?

text: Is there a way to move all footnotes to the end of the document (after the `thebibliography` environment)?


title: How to add the exact page numbers cited for books in the references list/bibliography, not in the text?

text: I am wondering if there is a package or an option in LyX that adds the page number to the references list. I don't want to generate a separate bibtex entry for each page cited of the same reference. Also, I don't want to add the page number next to the reference in the text because that is ugly and not accepted. I use `ieeetran` (not `IEEETran`) for referencing in LyX. LyX gives the option to add something after the citation: ![enter image description here](http://i.stack.imgur.com/tPV93.png), but this would include it in the text. ![enter image description here](http://i.stack.imgur.com/n6PAF.png) In short, what I'm looking for is something like this: ![enter image description here](http://i.stack.imgur.com/sCrf4.png) (as I said earlier, I can do this by generating a separate bibtex entry for each page cited, but that would be tedious!)


title: verbments (listings alternative) and UTF-8

text: This is a follow-up question to UTF8 for listings With these MWE I will not see the german umlauts in the resulted pdf (XeLaTeX was used):               \documentclass{article}     \usepackage{verbments}     \begin{document}     \begin{pyglist}[encoding=utf-8,language=text]     Test äöü Test     \end{pyglist}     \end{document}      What should I do to support UTF-8 in verbments?


title: Why does ltablex skip a number in captions?

text: The below example presents two tables with an `tabularx` environment (taken from package `ltablex`) and a caption. After each `tabularx`-table, the table counter skips one, as if both the `caption` and the `tabularx` environment increase it, while the latter shouldn't.               \documentclass{report}     \usepackage{ltablex}     \begin{document}          \begin{table}     \caption{Caption 1.} % "Table 1"     \begin{tabularx}{\linewidth}{|c|}     empty table     \end{tabularx}     \end{table}          \begin{table}     \caption{Caption 2.} % "Table 3"     \begin{tabularx}{\linewidth}{|c|}     empty table     \end{tabularx}     \end{table}          \end{document}      My reputation doesn't allow me to upload a picture, but the captions are Table 1 and Table 3 respectively.


title: Conflict between arabtex and algorithmic

text: Below is a minimal working example which recreates the problem I'm facing.               \documentclass{article}     \usepackage{algorithmic}     \usepackage{arabtex}     \begin{document}     \section{Introduction}     \RL{d}     \begin{algorithmic}     \STATE problem     \end{algorithmic}     \end{document}      I get the following error:                LaTeX Error:           Command \AND already defined.                    Or name \end... illegal, see p.192 of the manual.        1. I tried to use algorithmicx instead, and the same problem occur.   2. If I comment out the algorithmic section, the document compiles successfully   3. Tried to use savesym as follows but i am still getting the same error.              \usepackage{algorithmic}     \usepackage{savesym}     \savesymbol{AND}     \usepackage{arabtex}      Any help will be appreciated!


title: Textbox on frontpage

text: in my thesis I would like to include a "textbox" in the lower left corner of the front page. It should contain the names of my supervisors. But I'm not able to put a box there, I suppose it has to do with the "rules" of the class etc. Does anyone have a way around or...? This is how I start things off:                \documentclass[pdftex,10pt,b5paper,twoside]{book}      \begin{document}      \frontmatter      \title{\vspace{-10mm} \textbf{{\huge Header\\      SubHeader\\ \vspace{3mm} Thesis \\}}      \author{Mememe}      \date{\today}      \maketitle      \end{document}


title: How to prevent \xspace from adding a full space after a period?

text: I have a little macro that I use for doing adding an _e.g._ in my writing:               \newcommand{\eg}{\emph{e.g.}\xspace}      The problem I have is that LaTeX is treating the `g.` as the end of a sentence and is spacing too much. Is there any way to disable this feature?


title: PSTricks-NODES. How can I put 'Ñ' inside a circleNODE?

text: I want to type Ñ inside a circlenode, but it don´t appear in the final result. At the example, in the 3rd line of code. Are there any solution?                \begin{pspicture}(-2,-2)(12,6) %\malla      \rput(-1,-1){$\circlenode{V}{\textcolor{blue}{Vigo}}$}      \rput(0,2){$\circlenode{C}{\textcolor{yellow}{Coruña}}$}      \rput(2,0){$\circlenode{S}{\textcolor{red}{Scq}}$}      \rput(4,2){$\circlenode{P}{\textcolor{green}{Po}}$}           \ncarc[arcangle=33]{->}{V}{C}      \naput*{\small $45$}           \ncarc[arcangle=11]{->}{S}{P}      \ncput*{\small $25$}           \ncarc[arcangle=75]{->}{S}{P}      \ncput*{\small $15$}           \end{pspicture}


title: TexStudio Installation Problems in Ubuntu 12.04

text: I want to install TexStudio in Ubuntu 12.04. I cannot find it in Software Center. From command line if I use `sudo apt-get install texstudio` it says unable to locate package. Please help.


title: Font of \schemeref labels (chemstyle)

text: I'm using Chemstyle to label the compounds in my thesis and am using the a \renewcommand to re-size the labels. However, this seems to change the font as well. I need the numbers to be in Arial 8 pt or another non-serif font. Here's an example:                   \documentclass[11pt,oneside,a4paper]{report}         \usepackage[left=4.0 cm,right=2.0 cm,top=2.0 cm,bottom=2.0 cm]{geometry}         \usepackage{graphicx}         \usepackage{chemstyle}          \renewcommand*{\schemerefformat}{\fontsize{5pt}{6pt}\textbf{}} %set size of chemlabels                   \begin{document}              \leavevmode\compound*{cmpd1}         \compound*{cmpd2}         \compound*{cmpd4}             Arene \compound{cmpd1} was used to obtain a diastereomeric mixture upon complexation that was easily separable by column chromatography (\ref{sch2}). After hydrolysis of the ester the two enantiomeric complexes \textit{pS}-\compound{cmpd4} and \textit{pR}-\compound{cmpd4} were obtained.              \begin{scheme}[htbp]         \centering         \caption{Chiral resolution.}         \schemeref[TMP1]{cmpd1}         \schemeref[TMP2]{cmpd2}         \schemeref[TMP4]{cmpd4}         \includegraphics[width=0.82\textwidth]{1-3.eps}           \label{sch2}         \end{scheme}              \end{document}      And the output: ![enter image description here](http://i.stack.imgur.com/RapSW.jpg) Here's the dropbox link to the MWE if needed: Dropbox Folder with example and image


title: Usage of subcaption leads to a misalignment (horizontal and vertical)

text: I use the package "subcaption" to put my pictures into my script. I prefere to use subcaption instead of subfig because if I use \continuedFloat it makes a correct enumeration. Sadly the last two pictures are always slightly horizontally miscentered. Sometimes even the vertical distance of the last two pictures is completely wrong as you can see in the example. This is the code I use for my pictures:                \documentclass{scrartcl}     \usepackage{subcaption}     \usepackage[demo]{graphicx}     \begin{document}          \begin{figure}[!htbp]     \centering     \subcaptionbox{Abstand\label{bla}}     {\includegraphics[width=0.451\textwidth]{bla}}     \qquad     \subcaptionbox{Abstand\label{bla}}     {\includegraphics[width=0.451\textwidth]{bla}}     \qquad     \subcaptionbox{Abstand\label{bla}}     {\includegraphics[width=0.451\textwidth]{bla}}     \qquad     \subcaptionbox{Abstand\label{bla}}     {\includegraphics[width=0.451\textwidth]{bla}}     \qquad     \subcaptionbox{Abstand\label{bla}}     {\includegraphics[width=0.451\textwidth]{bla}}     \qquad     \subcaptionbox{Abstand\label{bla}}     {\includegraphics[width=0.451\textwidth]{bla}}     \qquad     \subcaptionbox{Abstand\label{bla}}     {\includegraphics[width=0.451\textwidth]{bla}}     \qquad     \subcaptionbox{Abstand\label{bla}}     {\includegraphics[width=0.451\textwidth]{bla}}     \vspace{3mm}     \caption{hallo}\label{bla}     \end{figure}          \end{document}      And it gives me this wrong result: ![Misalignment](http://www.bilderload.com/daten/abstaende1O42E.gif) Do you have any idea how to solve this problem? I use texlive 2014. Thank you very much :-)


title: Iterating over pgfkey list - macros inaccessible

text: I have to draw a number of annotated number lines such as this: ![annotated number line with arrows](http://i.stack.imgur.com/GJegt.png) For this I adapt the `pgfplots` interface with a few extra keys.               \begin{tikzpicture}     \begin{axis}[         number line,         xmin=-2,xmax=4,         xlabel={$f'(x)$\\$f(x)$},         xtick={-1,2},         interval labels={-1.5/$+$/$\nearrow$,0.5/$-$/$\searrow$,3/$+$/$\nearrow$},     ]     \end{axis}     \end{tikzpicture}      Nice and clean. The trouble is, sometimes I want a number line like this: ![annotated number line with quarter circles](http://i.stack.imgur.com/jj5J3.png) The quarter circles come from the `manfnt` package. But now my implementation of setting a key equal to a list and iterating over the list won't compile. Here is the full MWE:               \documentclass[png]{standalone}     \usepackage{tikz}     \colorlet{primary}{blue!40!black}       % HTML{000066}     \tikzstyle{number line value}=[primary,above]     \tikzstyle{number line description}=[primary,below]     \tikzstyle{number line point description}=[number line description,yshift=-2.5em,text width=2cm,text centered,anchor=south]     \usepackage{pgfplots}     \pgfplotsset{compat=1.8}     \pgfplotsset{every linear axis/.append style={axis x line=middle, axis y line=middle}}     \pgfplotsset{         number line/.style={%          axis x line=bottom,             ymin=0,ymax=0.1,             axis equal image,             hide y axis,             every axis x label/.append style={%                 anchor=west,                 align=left,             },         },         interval labels/.style={             after end axis/.prefix code={                 \edef\mylist{#1}                 \foreach \x/\val/\desc in \mylist {                     \ifx\val\desc                         \edef\temp{\noexpand\draw ({axis cs:\x,0}|-{axis description cs:1,0}) node[number line value] {\val};}                     \else                         \edef\temp{\noexpand\draw ({axis cs:\x,0}|-{axis description cs:1,0}) node[number line value] {\val} node[number line description] {\desc};}                     \fi                     \temp                 }             }         }     }     \usepackage{manfnt}     \newcommand{\nequartercircle}{\manquartercircle}     \newcommand{\nwquartercircle}{\manrotatedquartercircle}     \newcommand{\sequartercircle}{\rotatebox[origin=c]{180}{\nwquartercircle}}     \newcommand{\swquartercircle}{\rotatebox[origin=c]{180}{\nequartercircle}}          \begin{document}     \begin{tikzpicture}         \begin{axis}[number line,             xmin=-2,xmax=4,             xlabel={$f(x)$\\shape},             xtick={-1,0.5,2},             xticklabels={$-1$,$\frac12$,$2$},             % interval labels={-1.50//NW,-0.25//NE,1.25//SW,3.00//SE} % works, but not the symbols I want             % interval labels={-1.50//\nwquartercircle,-0.25//\nequartercircle,1.25//\swquartercircle,3.00//\sequartercircle} % doesn't work             after end axis/.append code={                 \coordinate (BR) at (axis description cs:1,0) {};                 \draw ({axis cs:-1.50,0}|-BR) node [number line description] {\nwquartercircle};                 \draw ({axis cs:-0.25,0}|-BR) node [number line description] {\nequartercircle};                 \draw ({axis cs: 1.25,0}|-BR) node [number line description] {\swquartercircle};                 \draw ({axis cs: 3.00,0}|-BR) node [number line description] {\sequartercircle};                 } % works, but not the desired interface         ]         \end{axis}     \end{tikzpicture}     \end{document}      I am guessing it has to do with how the macros in the list are expanded(`\nearrow` is not a macro, it's a character control sequence defined with `\mathchardef`), but beyond that I cannot tell.


title: Using pgfplot externalize with .eps output in letter 10cm*10cm

text: Using `pgfplots`, externalize an `.avi` file and using `DVI>ps`, externalize an `.eps` file on A4 but I want a figure with width and height of 10cm in letter (10cm x 10cm). How can I make it? (If you know how to make a figure that be equal the page size.) this is my code.                  \documentclass{report}     \usepackage{pgfplots}     \usepgfplotslibrary{external}     \tikzexternalize{question}     \setlength{\pdfpagewidth}{15 cm}      \setlength{\pdfpageheight}{15 cm}      \newpage     \thispagestyle{empty}     \begin{document}     \pgfplotsset{width=10cm,height=10cm}     \begin{tikzpicture}      \begin{axis}[        xlabel={$x$},        ylabel={\textbf{ $f(x)$ }}        ]        \addplot {x^2};        \addplot {x^3};      \end{axis}     \end{tikzpicture}     \end{document}


title: How to learn biblatex without knowing BibTeX

text: I've been using LaTeX for years, but I haven't learned how to use BibTeX. I've been manually inserting bibliographic entries into a `thebibliography` environment at the end of each document, which usually requires copying and pasting from a previous document. I've heard that BibTeX is a system that makes it easier to manage bibliographic data that I will likely use in many LaTeX documents. I've also heard that `biblatex` is an improved re- implementation of BibTeX. I would like eventually to learn to use `biblatex`. The problem is that the `biblatex` documentation seems to be written for the reader who already knows BibTeX and wants to upgrade to `biblatex`. So in order to understand the `biblatex` reference manual, I would need to learn all about BibTeX first, even though many of its features are replaced in `biblatex`. This seems like an inefficient and confusing way to go about it. Can someone direct me to a reference text or manual that explains how to use `biblatex`, for someone who knows LaTeX but has never used BibTeX?


title: problem about typesetting Chinese characters in Latex

text: I found the post How does one type Chinese in LaTeX? about how to typeset Chinese in Latex. I just encountered the same problem, and my questions are: 1.To type Chinese or Japanese, I have to have some particular packages (such as CJK/XeCJK) installed, don't I? 2.I'm confused by the first solution in that post, it looks like this:               % UTF-8 encoding     % Compile with latex+dvipdfmx, pdflatex or xelatex     % XeLaTeX is recommanded     % Some Chinese fonts should be installed in your system (SimSun, SimHei, FangSong, KaiTi)     \documentclass[UTF8]{ctexart}     \begin{document}     文章内容。     \end{document}      The above solution just uses a class `ctexart` without any particular packages, and I tried to replace `ctexart` with `article`, it failed. So I wonder what is special about `ctexart` which can display Chinese without any add-on packages?


title: XeLaTeX Section related page/figure numbering

text: Is there any good method to get section related page and figure numbering which also allows a consistant TOC/TOF? I am using the article class to write a technical manual. Section 1, Page numbering shall start with 1-1, 1-2 and so on. Section 2, 2-1, 2-2 etc. Same for figures. I found a lot of references to the chappg package but it doesn't seems to fit the requirements. on} Update: Code example modified based on David's help.               \documentclass[12pt]{article} % use larger type; default would be 10pt     \usepackage{fontspec} % Font selection for XeLaTeX; see fontspec.pdf for documentation     \defaultfontfeatures{Mapping=tex-text} % to support TeX conventions like ``---''     \usepackage{xunicode} % Unicode support for LaTeX character names (accents, European chars, etc)     \usepackage{xltxtra} % Extra customizations for XeLaTeX     \usepackage{lipsum}% for dummy text of 150 paragraphs     %*******************************HEADER LAYOUT*******************************     \usepackage{fancyhdr}     %Rewriting thepage to show section related numbering     \renewcommand\thepage{\thesection--\arabic{page}}     \rfoot{\thepage}     %*******************************SECTION OPTIONS*******************************     %Begin each section with a new page & reset numbering on each section.     \usepackage{titlesec}     \newcommand{\sectionbreak}{\clearpage\setcounter{page}{1}}     \begin{document}     \section{Getting started}     \subsection{Subsection}     \lipsum     \section{Operational Principles}     \subsection{Subsection}     \lipsum[1]     \subsubsection{Subsubsection}     \lipsum[1]     \paragraph{Paragraph}     \lipsum     \section{Forms}     \subsection{Subsection}     \lipsum[1-50]     \subsubsection{Subsubsection}     \lipsum[1]     \paragraph{Paragraph}     \lipsum     \end{document}


title: fancy heading ... \section{} titles disappears

text: By combining the next two questions-answers Fancy chapter headings and Section title gradient . I have this effect. The problem is that the name of `\section{}` disappears. What is wrong? ![enter image description here](http://i.stack.imgur.com/nUm6Y.png)               \documentclass[b5paper,svgnames,10pt]{book}     \usepackage[utf8x]{inputenc}     \usepackage{tikz}     \usepackage[explicit]{titlesec}     \usepackage{xcolor}     \usepackage{colortbl}     \usepackage[margin=1.5cm]{geometry}     \usepackage{lipsum}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      \usepackage[cm-default]{fontspec}     \setromanfont{FreeSerif}     \setsansfont{FreeSans}     \setmonofont{FreeMono}     \usepackage{xgreek}     \setmainfont{Arial}          %%%%%%%%%%%%%%%%%%%% fancy heading  \section %%%%%%%%%%%%%%%%%%%%%%          \titleformat{\section}[block]%                       {\huge\bfseries%          \tikz[overlay] \shade[left color=LightSkyBlue,right color=white,] (0,-1ex) rectangle (\textwidth,1em);}%             {\thesection}%                            {1em}%         {}          %%%%%%%%%%%%%%%%%% fancy heading  \chapter %%%%%%%%%%%%%%%%%%%%%%%%          \newcommand*\chapterlabel{}     \titleformat{\chapter}     {\gdef\chapterlabel{}       \normalfont\sffamily\Huge\bfseries\scshape}     {\gdef\chapterlabel{\thechapter\ }}{0pt}     {\begin{tikzpicture}[remember picture,overlay]         \node[yshift=-3cm] at (current page.north west)         {\begin{tikzpicture}[remember picture, overlay]             \draw[fill=LightSkyBlue] (0,0) rectangle             (\paperwidth,3cm);             \node[anchor=east,xshift=.9\paperwidth,rectangle,             rounded corners=20pt,inner sep=11pt,             fill=MidnightBlue]             {\color{white}\chapterlabel#1};           \end{tikzpicture}         };       \end{tikzpicture}     }     \titlespacing*{\chapter}{0pt}{50pt}{0pt}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}          \part{Ενέργεια}          \chapter{Κινητική}          \section{Κινήσεις}     \lipsum[1]          \section{Δυναμική}     \lipsum[1]          \end{document}


title: Good, plain, TeX editor

text: I'm looking for a TeX editor, _not_ a LaTeX editor. I usually run from the command line, so what I want is just the editing facilites. Specifially, I'd like a simple, lightweight editor providing customizable syntax highlighting. It would be nice if I could provide the program with one or more lists of commands to be displayed with different colours. I'm using Windows.


title: TikZ: Diagram of a perceptron

text: I'm trying to create a TikZ based version of the following diagram (taken from here), but I don't know how to approach it. It doesn't need to look exactly like the original, but the basic idea should be preserved. It would especially be great if the paths from *X_n* to the sum function were straight lines without a "bend" like in the original. That makes a matrix layout difficult to use. The definition of the output function can be left away. Could someone point me to an approach that will work in this case, or even create a tikz texample? ![Perceptron](http://i.stack.imgur.com/KUvpQ.png) * * * **Update:** I ended up combining the approaches by @m0nhawk and @Toscho and came up with this: ![Perceptron in TikZ](http://i.stack.imgur.com/IjJT0.png) Sourcecode is here: https://github.com/dbrgn/blog/blob/master/static/img/2013/3/26/perceptron.tex


title: Showing bibtex article entry "number" with revtex

text: I am using `revtex4-1` and BibTeX to create a bibliography. Most entries in my bib file shows up fine, but I am having troubles with two journals, Cosmology and astroparticle physics and Living Reviews in relativity that uses the BibTeX entry "number". For instance in my bib file if I write in a reference of type article:               number={4}      This entry is ignored in the bibliography so the information about the number does not get included. For "Living Reviews in Relativity" I can cheat and write an entry:               pages ={4}      instead and make the final bibliography look fine since I do not have to use the pages field for anything else. When I use the bibliographystyle "plainnat", "number" entry shows but not when I use the default `revtex` bibliographystyle. Is there some way of getting the "number" entry to show when using the default `revtex` bibliography style or should I not bother with this and send the article in to the journal and let the editors fix it or complain?


title: To show something are appearing n-times!

text: Suppose I want to write that the sequence 1,1,...,1 appear n-times. How will I do this? Usually in mathematics we use a braces at the bottom and write "n-times" below the brace.


title: Mixed Grouping in Subequations

text: I am looking to create a subequation environment with three equations. However, I want to group the 2nd and 3rd equations with a brace on the left side. I tried this (using the empheq package):               \begin{subequations}      \begin{align}        A&=B \\      \end{align}      \begin{empheq}[left=\empheqlbrace]{align}        C&=D \\        E&=F      \end{empheq}     \end{subequations}      But the alignment (as expected) between the two sets of equations doesn't come out well. Any hints?


title: Please Help to prepare the following table

text: ![enter image description here](http://i.stack.imgur.com/66KlA.png) Please, Help me inserting a table like this. I could not prepare this table even after using the \multicolumn package. I am facing difficulties with merging the rows and columns. I am in an urgent need. Please Help !


title: \markboth{}{} and CJK

text: I'm writing a Japanese dictionary using the `CJKutf8` package in LaTeX. I wrote a few macros to make entries and everything works fine except setting headers with `fancyhdr`. Using a macro:               \newcommand{\J}[1]{\begin{CJK}{UTF8}{song}#1\end{CJK}}      I type Japanese in Unicode, but in               \markboth{\J{#1}}{\J{#1}}      it doesn't compile and strange errors occur. This is a working example:               \documentclass[twocolumn]{book}     \usepackage[T1,OT4]{fontenc}     \usepackage{CJKutf8}     \usepackage{hanging}     \usepackage{ragged2e}     \usepackage{fancyhdr}     \usepackage{fix2col}     \pagestyle{fancy}     \fancyhf{}     \fancyhead[LE,RO]{\textbf{\rightmark\ -- \leftmark}}     \fancyhead[LO,RE]{\textsf{\textbf{\thepage}}}     \newcommand{\J}[1]{\begin{CJK}{UTF8}{song}#1\end{CJK}}     \newcommand{\E}[4]{\hangpara{3em}{1}\textbf{\J{#2・}}\J{#1}\ #3\ \textit{#4}\J{\markboth{#2}{#2}\cleardoublepage\par}}     \begin{document}     \E{愛}{あい}{miłość}{cn}     \E{青い}{あおい}{niebieski; \emph{rz.} zielony}{ia}     \E{青信号}{あおしんごう}{zielone światło na sygnalizatorze}{mn}     \end{document}      Of course I don't want to make every entry on a separate page so when I remove \cleardoublepage it it does not compile. How can I make a header with Japanese words in it?


title: linespacing without packages

text: I want to be sure that I understood this command as it was meant:   * the `\linespread` command offers **just two** values: 1.6 (two blank lines) and 1.3 (1 1/2 blank lines)   * set in the preamble, it affects the whole document   * to limit this to just an area, I must use:               \linespread{value}\selectfont   % sets (new) value for extra vertical space between lines     text input words input text     \linespread{1}\selectfont   % resets to value set in preamble OR default level      ## So here my questions: Is there a way to set, say, a value of 0.2 or negative values with this command, but **without** using extra packages? I am right at the beginning of learning LaTeX, and want to stick to the basic commands and basic functions as long as I could before I start using packages, extensions, etc. All I could find up to now was packages, or workarounds that seem a bit far from where I am at the moment.


title: Paths in TeXStudio

text: At least, in teTeX/Linux, one can use environment variables like `TEXINPUTS`, `BIBINPUTS`, `BSTINPUTS` to change default directories. In TeXStudio/Mac, how to access these like variables to specify others directories than the defaults? Specifically, I have my own `bibstyle.bst` file with the other tex files in just one working directory but `bibtex` can't see it.


title: Graphics on a high resolution display

text: I recently switched over to a laptop with a really high resolution display and now all of my .tex files with graphics are broken. Any idea what's happening here / how to fix it?


title: Show the large image in latex beamer into four parts / transitions

text: I have a large image that I want to show in my presentation. I have four panels on the graph. What I want to do is in each slide, I want to show each panel. How do we show the certain portion of the image only at each time ? For example I have a graph like this ![enter image description here](http://i.stack.imgur.com/pcFCF.png) How can I show each panel as full screen ?


title: Change line spacing inside a node in TikZ

text: Inside a TikZ node, one can force line breaks using `\\\` providing the `align` option of the node is set. I would like to increase the line spacing inside a node. This can be done in the usual way with the optional parameter of `\\\`, e.g. `\\\\[1em]`. Doing this for every line break is tedious though. Is there a way to increase the break _globally_ , so that any `\\\` inside a node acts as `\\\\[1em]`? EDIT: Almost there!               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{shapes}          \begin{document}          \tikzset{       mynode/.style={         draw       , align=center       , execute at begin node=\setlength{\baselineskip}{2em}       }     }          \begin{tikzpicture}       \node[mynode] {         this \\         is \\         \tikz \node[mynode] {a \\ break};       };     \end{tikzpicture}          \end{document}      This produces: ![Node breaks](http://i.stack.imgur.com/2UJOP.png) The remaining question is how to place a 2em break before the inner node.


title: Persistent "hanging" tick label

text: I have sort of a strange problem. I produced a 3x2 plot array in Matlab, and removed all of the y-axis tick labels. The relevant code (for the problematic plot) is below               \begin{tikzpicture}          \begin{axis}[%     width=\figurewidth,     height=\figureheight,     scale only axis,     scaled y ticks = true,     xmin=0,     xmax=50,     xtick={ 0, 10, 20, 30, 40, 50},     xmajorgrids,     ymin=0,     ymax=15e6,     ytick={0,5e6,10e6,15e6},     yticklabels={,,,},     name=plot1,     at=(plot3.above north west),     anchor=below south west     ]     \addplot [     color=blue,     solid,     forget plot     ]     table[row sep=crcr]{     1 102360.942462359\\     2 85927.6966525591\\     3 2845564.93058913\\     };     \end{axis}     \end{tikzpicture}%      The other plots are similar, but without this problem. The resulting figure is ![enter image description here](http://i.stack.imgur.com/lQUOJ.png) There's that orphaned tick label in the top left corner, and I don't know why it's there or how to get rid of it. Any ideas?


title: Put hyphen into equation

text: Probably a pretty simple question, but how do I make a hyphen in a LaTeX equation? Currently I have:               \begin{equation}     F-score = ....     \end{equation}      But it renders as _F - score_ when I want _F-score_. Suggestions?


title: Removing page numbers after references

text: **PROBLEM FIXED** **The problem was found within the custom class I was using, {Latex/Classes/PhDthesisPSnPDF} as I was using the CUEDThesisPSnPDF template for my thesis. Within the class I searched for pagebackref in the hyperref package and just added "= false", so it now reads pagebackref = false,** I'm having a bit of trouble trying to remove the page number hyperlinks displayed after references in the bibliography, for example: [39] E. Economou, Green's Functions in Quantum Physics. Springer, 3rd ed., 2006. **7, 26** I found on a previous answer that the usual culprit is **\usepackage{hyperref}** in the preamble, but after disabling this I still have the problem. I can't see any other reference package that might be enabling this option, but here is the preamble and the bit where I insert my refernces. I also tried changing reference styles but this didn't remove the page numbers either!               \documentclass[oneside,12pt]{Latex/Classes/PhDthesisPSnPDF}          \include{Latex/Macros/MacroFile1}          \usepackage{enumerate}            \usepackage{amsmath}              \usepackage[T1]{fontenc}          \usepackage{graphicx}             %\usepackage{hyperref}          \usepackage{amssymb}          \usepackage{cancel}          \graphicspath{{./Images/}}          \usepackage{float}          \usepackage{subfigure}          \usepackage{sidecap}          \usepackage{caption}      .....               \bibliographystyle{ieeetr}          \bibliography{references}          \end{document}


title: Unexpected behavior in authoryear-comp (biblatex)

text: I'm a reasonably experienced XeLaTeX + BibTeX + natbib user trying to transition to using biblatex. I want to generate a citation label such as "(Doe et al. 2001a,b, 2002)" despite the fact that the three entries all have distinct (unique) lists of authors. So far, using MacTeX-2011, the best I can get is "(Doe et al. 2001a; Doe et al. 2001b; Doe et al. 2002)". Any ideas how I could achieve that? I'd be grateful for any suggestions. Please note that I'm asking how it might be done, rather than whether it should be done at all. I understand that you might not like this citing convention. Here is my source file:               \documentclass{article}          \begin{filecontents}{test.bib}          @article{doe2001a,     title = {foo},     year = {2001},     author = {J. Doe and R. Smith},     journal = {Nature}     }          @article{doe2001b,     title = {bar},     year = {2001},     author = {J. Doe and B. Dylan},     journal = {Science}     }          @article{doe2002,     title = {foobar},     year = {2002},     author = {J. Doe and B. Dylan and R. Smith},     journal = {WSJ}     }          \end{filecontents}          \usepackage[%       style=authoryear-comp,       backend=biber,       maxbibnames=99,       maxnames=1,       uniquelist=false,       uniquename=false]{biblatex}     \addbibresource{test.bib}          \begin{document}          \noindent     \parencite{doe2001a,doe2001b,doe2002}.          \printbibliography          \end{document}


title: Annuity notation in LaTeX

text: How do you write this in LaTeX: ![enter image description here](http://i.stack.imgur.com/dABw2.jpg)


title: How to center image in 2 column tabular when one side is Verbatim?

text: I am having hard time finding the correct way to typeset this: I need to have code as verbatim on one side of the page, and show the output (an image) on the right side of the page. I have tried using minipage, but that did not work well. I am now trying using a table with 2 columns. I put the verbatim text in the left column, then the image in the right column. The problem is that the alignment is not coming out right. I tried all the tricks I know about which are `\raisebox{-.5\height}` or using `m` for column specification. Here is the output from a MWE: ![Mathematica graphics](http://i.stack.imgur.com/D3pXB.png) I'd like it to show up as follows (This was drawn manually using cut/paste) with the help of Visio and paint.exe ![Mathematica graphics](http://i.stack.imgur.com/uYtbZ.png) Here is the code (using demo option for Graphics so it works as is)               \documentclass[11pt,notitlepage]{article}%     \usepackage{verbatim}     \usepackage{fancyvrb}     \usepackage[demo]{graphicx}     \usepackage{epstopdf}%     \usepackage[margin={2cm}]{geometry}%     \usepackage{array}%for m option          \begin{document}          \begin{tabular}[c]{|p{4in}|p{3in}|}\hline     %   \begin{tabular}{|p{4in}|m{3in}|}\hline    %also tried this, same problem     \begin{Verbatim}[fontsize=\small]     Clear["Global`*"];     SetDirectory[NotebookDirectory[]]     sys = TransferFunctionModel[1/(s^2 + 2/10 s + 1), s];          yStep = Assuming[t > 0,        Simplify@OutputResponse[sys, UnitStep[t], t]];     yImpulse = Simplify@OutputResponse[sys,DiracDelta[t],t];     p = Grid[{        {Plot[Evaluate@{yStep, yImpulse}, {t, 0, 50},          PlotRange -> {{0, 50}, {-0.8, 2.0}},          Frame -> True,          FrameLabel -> {{"y(t)", None},                         {t, "step and impulse reponse"}},          GridLines -> Automatic,          GridLinesStyle -> Dashed,          ImageSize -> {300, 300},          PlotStyle -> {Red, Black},          AspectRatio -> 1]         },        {         Row[{"step response=", Re@yStep}]         },        {Row[{"impulse response=", Re@yImpulse}]}        }, Alignment -> Left, Frame -> True]          yStep          {1 - E^(-t/10) Cos[(3 Sqrt[11] t)/10]        - (       E^(-t/10) Sin[(3 Sqrt[11] t)/10])/(3 Sqrt[11])}          yImpulse          {(10 E^(-t/10) HeavisideTheta[t]        Sin[(3 Sqrt[11] t)/10])/(3 Sqrt[11])}     \end{Verbatim}     &     \raisebox{-.5\height}{\includegraphics[width=3in,height=3in]{whatever}}     \\\hline     \end{tabular}          \end{document}      TexLive 2013, Linux


title: Angles in Chemfig

text: I want to draw this formula using chemfig: ![BCA Cu+ Complex](http://i.stack.imgur.com/Q55kq.png) This is what I've got so far:               \chemfig{Cu^+(-[:180]N**6(-**6(------)--(-OOC-)---))(-[1]N)(-[5]N)(-[7]N)}      ![my try](http://i.stack.imgur.com/GKnUW.png) I don't get the angle from N to Cu+ right. I tried to rotate parts of the formula, but there is always at least one angle that does not fit. Any idea?


title: Two authors in a reference: converting “and” to comma

text: As I said in the title I have a problem with bibliography and citations: I use the `unsrt` BibTeX style. I know that in order to separate different authors in the `authors` field in a .bib file I have to use `and` instead of the comma. That works perfectly when there are more than two authors in my citation, but when there are only two authors I noticed that there are no commas displayed in the output. e.g.                 \documentclass[a4paper,11pt]{article}       ...            \bibliographystyle{unsrt}       \bibliograpy{bibfilename}      Here is two entries for the bibfilename.bib, respectively with three and two authors:                 \begin{thebibliography}            @article{article1,       title = {Title1},       volume = {123},       number = {11},       journal = {Journal},       author = {Power, J. and Rower, C. and Atkins, D.},       year = {2012},       pages = {5780--5817}       },      that correctly produce > J. Power, C. Rower, D. Atkins ... and then                 @article{article2,       title = {Title2},       volume = {123},       number = {3},       urldate = {2013-10-26},       journal = {Journal 2},       author = {Power, J. and Rower, C.},       year = {1995},       pages = {211--220},       },      that produce > J. Power C. Rower without the separating comma. How can I fix this problem? Thank you in advance.


title: List of theorems with thmtools not working - Missing \endcsname inserted

text: I am trying to generate a list of all equations in a document. I have searched and it seemed a good solution would be to use the `thmtools`, which can generate a list of all theorems(if im correct). What I am looking for is (in the following example, at the chapter CheatSheet) a list with the contents of all equate-theorems, as such (with LaTeX formatting):               $Some_{Lowtext}$                                   (1)     $Some^{Hightext}$                                  (2)      Minimal (not) Working Example:               \documentclass[a4paper,12pt]{report}     \usepackage{theorem}     \newtheorem{equate}{}     \usepackage{thmtools}     \renewcommand{\listtheoremname}{List of Equations}     \begin{document}     \tableofcontents     \newpage     \chapter{Name of Chapter}     \section{Name of Section}     \subsection{Name of SubSection}     sometext     \begin{equate}     $Some_{Lowtext}$     \end{equate}         Some other Text     \begin{equate}     $Some^{Hightext}$     \end{equate}         And some more          \chapter{CheatSheet}          \listoftheorems          \end{document}      This gives me the following errors (line 24 is the line after `\listoftheorems`):               test.tex:24: Missing \endcsname inserted. []     test.tex:24: Too many }'s. []      I am wondering if this is the way to produce such a list and how I can solve my error.


title: Drawing Brillouin Zones in TikZ

text: I'm trying to get TikZ to draw Brillouin Zones for two dimensional lattices, but I've not had much luck so far with anything I've tried. Brillouin zones are, basically, the area of space around a point in the lattice which is closest to that point, and so are similar to Voronoi diagams. You can see what these look like in this image, which has the first, second, and third Brillouin zones drawn on: ![first three brillouin zones](http://www.eelvex.net/wp- content/gallery/brillouin_zones/zoom_4_brillouin_zones.png) If I were to draw this by hand I'd construct the first Brillouin zone by drawing a line from the centre point in the lattice out to each of the points a distance of 1 (taking the lattice points to be separated by a unit distance) from the centre point, so that would be the ones north, east, south and, west of it. Then I'd take the perpendicular bisectors (in physics parlance these are Bragg planes) of each of these lines. The first Brillouin zone would then be the area which is enclosed by the perpendicular bisectors (and is the grey area shaded on the image above). The higher zones are constructed in the same way; a slightly variant explanation is given on this site. It also has code in Asymptote, but it seems to just be hard-coded in. Is there a way that this can be done in TikZ, and is there a way that it can be done both for any given lattice, and for any number of Brillouin zones? I've tried a few approaches, without success, including various attempts to do it with Lua (which I'm very unproficient in), but the only thing I really have working is a way of drawing the lattice points, which I've included here for a square lattice, but it's not too difficult to modify this to give a hexagonal lattice.               \documentclass{standalone}     \usepackage{tikz}     \begin{document}     %%% For a square lattice     \begin{tikzpicture}     \foreach \x in {-2, ..., 2}{         \foreach \y in {-2, ..., 2}{             \fill [black] (\x, \y) circle (0.1);         }        }     \end{tikzpicture}     \end{document}


title: Cannot "kern back" after applying kerning

text: Usually when I apply kerning to a pair of characters, I undo the kerning by adding the negative of the kerning afterwards, i.e. `{x}\kern1em\\{y}\kern-1em` (cf. Move a combining character with both \raisebox and \kern). But in this case, I cannot undo the kerning. If I add the negative of the kerning afterwards, the following character is pushed away, but if I don't add it, the following character is drawn towards the previous character.               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Times New Roman}          \newcommand{\longa}{\char"0101}     \newcommand{\myacute}{\char"00B4}     \newcommand{\stressedlonga}{\longa\kern-.35em\raisebox{.35ex}{\myacute}\kern.35em}     \newcommand{\newstressedlonga}{\longa\kern-.35em\raisebox{.35ex}{\myacute}}     \begin{document}     \noindent{\stressedlonga}a\\ % characters are too far apart     aa\\ % this is the correct spacing between two characters     {\newstressedlonga}a % characters are too close together     \end{document}      ![enter image description here](http://i.stack.imgur.com/ZjUip.png) **EDIT** * * * egreg is suggesting what I first attempted here, which was to add the combining acute accent `U+0301` rather than the full-width character `U+00B4`. For reasons I fail to understand, however, as soon as I attempt to modify the placement of `U+0301` (which I want to do in order to match `U+1E53`), the accent shifts rightwards, and nothing I do will make it move back. In the example below, I'm not kerning the accent at all, yet it shifts rightwards.               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Times New Roman}          \newcommand{\longa}{\char"0101}     \newcommand{\combiningacute}{\char"0301}     \newcommand{\stressedlonga}{\longa\raisebox{-.1ex}{\combiningacute}}          \begin{document}     \noindent{\stressedlonga}{\char"1E53}\\     {\longa\combiningacute}{\char"1E53}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Te4tX.png)