title: matching height of subfloats by defining height screws up captions

text: I am Using the following method to put two pictures beside each other in one figure:               \begin{figure}[ht]         \centering               \subfloat[ Caption 1 ]{\includegraphics[height=5cm]{Bilder/Peltiermodell/Waermestroeme}}             \qquad         \subfloat[ Caption 2 ]{\includegraphics[height=5cm]{Bilder/Peltiermodell/Waermestroeme_ES}}          \caption{ Maincaption  }\label{fig:waermestroeme}                \end{figure}      Using the height in stead of the width to define the size lets me match the height of graphics with different aspect ratios pretty easily. The problem is that the sub caption of the second subfigure is shifter to the right. This does not happen when defining size using the width. The caption format is configured as follows:                \usepackage[format=hang,indention=0.0cm ,labelfont = bf,width=0.9\textwidth, font=small,]{caption}      /edit added a minimal example:               \documentclass[a4paper,12pt,twoside]{report}     \usepackage{graphicx}        \usepackage{subfig}     \usepackage[format=hang,indention=0.0cm ,labelfont = bf,width=0.9\textwidth, font=small,]{caption}  %             \begin{document}     \begin{figure}[ht]%---------------Doppelbild:Wärmestroeme--------             \centering         \subfloat[Caption 1]{\includegraphics[height=5cm]{Bilder/Peltiermodell/Waermestroeme}}             \qquad         \subfloat[Caption 1]{\includegraphics[height=5cm]{Bilder/Peltiermodell/Waermestroeme_ES}}                \caption{main caption}\label{fig:waermestroeme}     \end{figure}     \end{document}      the problem seems to be with the width=0.9\textwidth in the caption setup...but if i ged rid of that it extends all the captions to text width wich doesn't look too good. Can I make it work anyways ? Maybe change the caption setup just for this one float ? how would I do that ? Why does this not happen when defining the size using the width ? lots of questions :-) thanks for the help !!


title: Referencing Style

text: My current references/bibliography at the end are in the style of: > Kenneth J. Arrow, Leonid Hurwicz, and Hirofumi Uzawa. Constraint > qualifications in maximization problems. Naval Research Logistics Quarterly, > 8:175–191, 1961. I'm trying to change it to: > Arrow KJ, Hurwicz L, Uzara H (1961) Constraint qualifications in > maximization problems. Naval Research Logistics Quarterly, 8:175–191. Any help (or advice for a more suitable referencing style). I like the citation style I have at the minute.               \documentclass{article}     \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @article{ahu61,        author={Arrow, Kenneth J. and Leonid Hurwicz and Hirofumi Uzawa},        title={Constraint qualifications in maximization problems},        journal={Naval Research Logistics Quarterly},        volume={8},        year = {1961},        pages = {175-191}      }      \end{filecontents}          \usepackage[round]{natbib}          \begin{document}     Lorem ipsum dolor \citep{ahu61} sit amet, consectetur adipiscing elit.     \nocite{*}     \bibliographystyle{plainnat}     \bibliography{\jobname}{}     \end{document}


title: Left aligning equations without align character

text: I realise that this has been asked many times before, but no answers I've found seem to provide a solution to my question. I'd like to left align all text in an `align` block, in:               \documentclass{article}     \usepackage{amsmath}          \begin{document}          \begin{align}     b := (a \oplus s_1) \oplus s_2 \\     e := 0 \\     \end{align}          \end{document}      This presents me with: ![enter image description here](http://i.stack.imgur.com/RjCga.png) If I change the first line to `\documentclass[fleqn]{article}` , then instead I get: ![enter image description here](http://i.stack.imgur.com/YApdQ.png) What I'm really looking for is the ability to align the first character on every line in the `align` block, to the far left i.e. so that `b` and `a` are vertically aligned. I would much rather not have to use a character such as `&` to guide the alignment, I'd prefer to always be the first character of each word after a `\\`.


title: Naming coordinates in a foreach loop

text: I have the following problem: I am using `beamer` together with `tikz`, and I want to use some random points in a drawing which is shown over a couple of slides. If I use the normal random method, the points are regenerated after each slides, having different coordinates which I dont want:               \foreach \x in {1/6,3/6,5/6}       \foreach \y in {1/6,3/6,5/6}         \draw[fill,scale=1] ($ (\x,\ y) + 1/10 * (rand, rand) $)           \coordinate ( \x\y ) node[circle, fill, inner sep=1pt] {};      Obviously I need to somehow save the coordinates for later use. I thought that I could to this using for loops declaring coordinates:               \foreach \x in {1/6,3/6,5/6}       \foreach \y in {1/6,3/6,5/6}         \coordinate( \x\y ) at ($ (\x,\ y) + 1/10 * (rand, rand) $);      This seems to work, but I can't access the coordinates later:               \foreach \x in {1/6,3/6,5/6}       \foreach \y in {1/6,3/6,5/6}         \draw[fill,scale=1] ( \x\y )           \coordinate ( \x\y ) node[circle, fill, inner sep=1pt] {};      This piece of code gives me the error: "No shape named 1/61/6." I don't know if I am going about this in the right way, I would really appreciate any help.


title: Aligning conditions in cases environment

text: I have a piecewise function with three "parts." I would like to have all three conditions aligned at the variable x. How do I achieve that? Here is the code I have so far:               \[     f(x) = \begin{cases}                      mx^2 +nx +1, & x \le -1 \\                      2m e^{|x|-1} + \sin \pi x - 3n, & -1 < x < 1 \\                      3x^2 - (m+n)x, & x \ge 1                 \end{cases}     \]


title: "Missing number" error with SCfigure (from sidecap package)

text: Does anyone know how to do "side captions" in LaTeX if you already have a caption environment specified? I keep getting an error when I use `SCfigure`. Ex:               \documentclass{article}     \usepackage{sidecap}          \begin{document}     \begin{SCfigure}[h!]     \centering     FIGURE     \caption{CAPTION}     \label{conforms}     \end{SCfigure}     \end{document}


title: How to split and align equations when they are inside an enumerate environment?

text: How to make the first line of aligned equations sit in the same baseline as the bullet and make the equation left justified? ![enter image description here](http://i.stack.imgur.com/d8vkd.png)               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{itemize}         \item $3!=3\times2\times1=6$         \item $\tfrac{5!}{3!}=\tfrac{5\times4\times3!}{3!}=5\times4=20$         \item \begin{align*}                         \frac{n!}{(n-2)!}   &=\frac{n\times(n-1)\times(n-2)!}{(n-2)!}\\                                                             &=n\times(n-1)\\                                                             &=n^2-n                     \end{align*}     \end{itemize}     \end{document}


title: Aligning equations with a label

text: I just discovered how to use `flalign*` to left justify my multi-line equation, but I would like it to start immediately after the `a) lim...` in my `enumerate` without going to the next line.               \begin{enumerate}       \item \begin{flalign*}               L&=\lim\limits_{n\to\infty}\frac{n}{n^2-1}&\\                &=\lim\limits_{n\to\infty}\frac{n}{n^2-1}\frac{(\frac{1}{n^2})}{(\frac{1}{n^2})}\\                &=\lim\limits_{n\to\infty}\frac{\frac{n}{n^2}}{\frac{n^2}{n^2}-\frac{1}{n^2}}\\                 &=\lim\limits_{n\to\infty}\frac{\frac{1}{n}}{1-\frac{1}{n^2}}\\                &=\frac{0}{1-0}\\                &=0              \end{flalign*}        \item      It always goes to the next line. How do I move it up?


title: pgfplot barchart moving x-axis up

text: For the MWE below:               \documentclass{report}     \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \usepackage[T1]{fontenc}     \usepackage{tikz,pgf}               \usepackage{pgfplots}     \usepackage{slashbox}     \usepackage{bchart}               \usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%         decorations.pathreplacing,decorations.pathmorphing,shapes,%         matrix,shapes.symbols,automata}          \begin{document}          \begin{figure}[H]     \centering     \begin{tikzpicture}     \begin{axis}[     ybar,     ylabel={Time Elapsed (in hours)},     xlabel={Methods},     legend style={at={(0.5,-0.15)},     anchor=north,legend columns=-1},     width=0.8*\textwidth,     height=9cm,     bar width=7pt,     symbolic x coords={Category-1,Category-2,Category-3},     xtick=data,     %nodes near coords,     %nodes near coords align={vertical},     ]             \addplot             coordinates {(Category-1,0.14) (Category-2,2) (Category-3,13.25)};             \addplot             coordinates {(Category-1,2.76) (Category-2,2) (Category-3,29.55)};             \addplot             coordinates {(Category-1,2.81) (Category-2,2) (Category-3,16.04)};             \legend{byHalf, Random, Hybrid}         \end{axis}     \end{tikzpicture}     \end{figure}          \end{document}      How can I make my x-label move up so that it touches the bars ? ![enter image description here](http://i.stack.imgur.com/tMlem.png)


title: Vertical alignment of align* in enumerate

text: > **Related (but not the same)** :   >  Align number from enumerate with equation   >  Displaying an equation in a list Earlier today I asked a question about aligning equations in an `enumerate` environment and got an answer that seemed to work for the example I gave, but it turns out I wasn't really specific enough for my problem. I'm using `align*` environments, often as the only part of a list item. (If you're wondering why I'm not using more words to introduce the `align*`, these are mostly homework solutions where most of the work is algebra, etc.) Here's my code and what it makes (above the middle line):               \begin{enumerate}       \item \begin{align*}         x^2 + y^2 &= x^2 + (iy)^2 \\                   &= (x + iy) (x - iy)       \end{align*}       \item \begin{align*}         \frac{1}{n^2-4} &= \frac14 \frac{4}{(n-2)(n+2)} \\                         &= \frac14 \left( \frac{1}{n-2}-\frac{1}{n+2} \right)       \end{align*}     \end{enumerate}      ![sad things](http://i.stack.imgur.com/hbs37.png) I'm trying to make the baseline of the first line of the `align*` environment the same as the number's baseline—I want the first line of the `align*` to have the same vertical position (centered horizontally in the same way) relative to its number as in the second half of my picture. (Side question: why is there so much space before the `align*` starts?)


title: left-justified text in the same line as the beginning of \align equations

text: > **Possible Duplicate:**   >  Vertical alignment of align* in enumerate   >  How to split and align equations when they are inside an enumerate > environment?   >  pgfplot barchart moving x-axis up I want to start a line with something easy as "a)" as left-justified text. But I want to have the beginning of `\align` equations on that same line. But, of course, if I use the `\align` order it jumps automatically in a new line and starts there with the first equation. Is there a way to work around this?


title: Roman numeral numbering for introductions

text: Is there a way to automatically use roman numeral numbering for introduction pages and introductory tables, which would then switch to arabic numerals for the rest of the document?


title: How to use \autocite with biblatex-apa?

text: I'm trying to use `\autocite` feature with biblatex-apa, but it seems that the `\autocite` macro is not defined in biblatex-apa 5.7 (and biblatex 2.5). Example code follows:               \documentclass[a4paper]{article}     \usepackage{fontspec} % using XeLaTeX     \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[style=apa]{biblatex}     \DeclareLanguageMapping{american}{american-apa}     \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @BOOK{Husserl1962,       author = {Edmund Husserl},       title = {Die {Krisis} der europäischen {Wissenschaften} und die         transzendentale {Phänomenologie}},       publisher = {Martinus Nijhoff},       year = {1962},       address = {Haag},       series = {Husserliana},       edition = {2},       type = {Husserliana VI}     }     \end{filecontents}     \addbibresource{\jobname.bib}          \begin{document}     Phenomenology is always fun \autocite{Husserl1962}.          \printbibliography     \end{document}      This results in the following error:               ! Undefined control sequence.     l.25 Phenomenology is always fun \autocite                                               {Husserl1962}.      A quick fix would of course be to add `\let\autocite=\parencite` before \begin{document}, but I guess that should rather be a part of apa.cbx or something.


title: Bold math using mathspec

text: I can't seem to make my math come out in bold using the `mathspec` package. Consider this example:               \documentclass{article}          \usepackage{mathspec}     \setallmainfonts{Times New Roman}          \begin{document}          \textbf{This line should all be bold: {\boldmath $17^2 = 289$}.}          \end{document}      When compiled, it gives: ![bm](http://imgur.com/fvP04.png) If `mathspec` is not used, then the math is bold, like it should be. How can I make my custom-font math bold as well?


title: How to protect text from being split by a float?

text: Given following situation:               \begin{figure}[ht!]         ...     \end{figure}     \begin{equation}         ...         \end{equation}     Some one-line text.     \begin{eqnarray}         ...         ...     \end{eqnarray}      how can I make sure that the float doesn't get placed between the equation and the equation array? Also the part to protect goes over two pages, if that's of any importance.


title: Avoid splitting of itemize lists by floats?

text: > **Possible Duplicate:**   >  How to protect text from being split by a float? I have a list constructed using `itemize` which is split by a figure. Is it possible to prevent the figure from splitting the list of items?


title: Do not place here

text: In a document containing theorems with proofs and floating objects, LaTeX automatically places the floating object between the theorem and its proof (because the proof is on the next page). Is there a way to tell LaTeX not to place floating objects between the theorem and the proof.


title: Prevent float from splitting paragraph

text: > **Possible Duplicate:**   >  How to protect text from being split by a float? I have this LaTeX like code               \begin{figure}...\end{figure}          [my paragraph text]      The output is               my paragraph      ------ <new page>     [Figure]     text      Essentially because the figure won't fit at the bottom of the page it goes to the top of the next page. BUT latex decides to place half of the paragraph text at the bottom of the page. I want               ------ <newpage>     [Figure]     my paragraph text      I do not want the figure to "split" the paragraph in the middle. It looks wrong the way it is. I simply want the paragraph to be below the figure the way I typed it in LaTeX.


title: How to plot the graph below?

text: May I know how to draw the graph as shown below? ![enter image description here](http://i.stack.imgur.com/cXIMj.png) below is a code I have try but with look and feel that is quite far away from the example:               \begin{tikzpicture}     \begin{axis}[         legend pos=north west,         width=6cm     ]     \addplot plot coordinates {     (2, 48)     (3,336)     (4,2048)     (5, 11520)     (6, 61440)     (7, 315392)     };          \addplot plot coordinates {     (2, 37)     (3, 275)     (4,1726)     (5, 9953)     (6, 55387)     (7, 297786)     };          \addplot plot coordinates {     (2, 43)     (3,252)     (4, 1421)     (5, 7256)     (6, 37561)     (7,181679)     };          \legend{Unreduced, Symmetric, Asymmetric}     \end{axis}     \end{tikzpicture}


title: \nopagebreak and \penalty

text: What is the difference between `\nopagebreak` and `\penalty`? (Other than the obvious fact that their arguments are measured on different scales.) When should one use one, and when the other?


title: Nested Environ's give "! Argument of ... has an extra }" error

text: I tried using two Environ's in a nested fashion, but I get the               ! Argument of \marray has an extra }      error. Any idea why this happens?               \documentclass{minimal}     \usepackage{amsmath,environ}          \NewEnviron{meqmultinum}[1]{     \begin{equation}\begin{split}     \BODY     \end{split}\label{eq:#1}\end{equation}     }          \NewEnviron{marray}[2]{     \renewcommand*{\arraystretch}{#2}     \begin{array}{#1}     \BODY     \end{array}     }          \begin{document}          \begin{meqmultinum}{test}     a&=\begin{marray}{l l}{1.2}     \alpha & \beta\\     \gamma & \kappa     \end{marray}\\     b&=\begin{array}{l l}     \alpha & \beta\\     \gamma & \kappa     \end{array}     \end{meqmultinum}          \end{document}


title: Numbering an array as one single equation LaTeX

text: I've looked around at various sites and tried switching between `array`/`eqnarray` but don't seem to be able to get the effect I would like. I want to simply give an array I have one single equation number. I would also like to know just to make sure, how to give each equation a number within an array. The equation I have is the following:               $$     \begin{array}{lr}     N_{x,sk} = k_{sk}\left(\frac{t_{sk}}{b_{sk}}\right)^{2}\bar{Et} \;\;     N_{x,st} = k_{st}\left(\frac{t_{st}}{b_{st}}\right)^{2}\bar{Et}     \end{array}     $$      Could someone please help provide examples where I would have these equations showing one equation number and then also an example with two separate ones please?


title: How to balance last page of two-column layout?

text: I create a document in two-column-layout with LaTeX (and Koma-Script, if that is relevant). The two-column-layout is defined in documentclass. The last page of an chapter fills the left column first - the result is that both column are of different length. How can I balance that? **EDIT:** `flushend` like mentioned in the answer of _TH._ doesn't work for me. Maybe it is conflicting with some other package I use? **EDIT 2:** OK, after I tested with lipsum like suggested from _Joseph Wright_ I saw it balanced. I tried a little bit and could find out, that flushend only balances the columns in the last chapter, not in all of them. Knowing that, I could see, that it is true for my document too, the last chapter has balanced columns. How can I achieve it for all of them? Here my short example:               \documentclass[a4paper, 10pt, twocolumn, DIV=18]{scrbook}              \usepackage{flushend}         \usepackage{lipsum}              \begin{document}              \chapter{test}                  \lipsum             \lipsum              \chapter{second}                  \lipsum             \lipsum              \chapter{third}                  \lipsum             \lipsum          \end{document}


title: Page styles with Koma instead of titlesec

text: I usually set up my page style `titlesec` along the lines of               \documentclass{scrartcl}     \usepackage[pagestyles]{titlesec}     \newpagestyle{mypagestyle}{       \headrule       \sethead{Document Title}{\sectiontitle}{\pagename\space\thepage}       \setfoot{Some Static Info}{Author}{Other Static Info}     }     \pagestyle{mypagestyle}      But now I read that there are Incompatibilities between KOMA-Script and titlesec. Although I did not notice those incompatibilities, I am a little concerned. Is there a way to define the page style without using `titlesec`, but still keep it as clear and powerful?


title: Numbering a set of horizontally distributed equations

text: Having different horizontally distributed equations inside an `align` environment, only lines are numbered, but not individual equations. How can the left equations be numbered using `subequations`? See also the question side-by-side equations, with equation numbers for each               \documentclass{article}     \usepackage{amsmath}     \begin{document}       \begin{subequations}         \begin{align}            %\label{a}             a &= a ,&           \label{b}             b &= b ,\\           %\label{c}             c &= c ,&           \label{d}           d &= d .         \end{align}       \end{subequations}     \end{document}      ![enter image description here](http://i.stack.imgur.com/kktdj.png) The solution should be able to either:   * attach a label to the left equations, or   * modify the labels on the right to read (1a,b) and (1c,d)  I couldn't find anything in the documentation of `amsmath` or other packages.


title: How do I give two equations different reference numbers on the same line?

text: Consider the following equation:               \begin{align}      & A x = b & C x = d.     \end{align}      Is there a possibility to count both the left equation and the right equation separately, so I can refer to them separately? I would prefer if this is done without subequation, so the count continues.


title: Align horizontally side by side equations

text: I would like to align these two side by side systems of equations horizontally. I tried to do this like this               \documentclass[12pt,letterpaper]{article}     \usepackage{amsmath}     \begin{document}     \begin{center}     \begin{tabular}{p{4cm}p{4cm}}     {\begin{align}     &\alpha =\alpha_{1}=\sqrt[3]{19}\nonumber \\     &\alpha_{2} =\varepsilon\sqrt[3]{19}\nonumber \\     &\alpha_{3} =\varepsilon^2\sqrt[3]{19}\nonumber     \end{align}}     &     {\begin{align}     &\beta =\beta_{1}=\frac{1+\sqrt[3]{19}+\sqrt[3]{19^2}}{3}\nonumber \\     &\beta_{2}=\frac{1+\varepsilon\sqrt[3]{19}+\varepsilon^2\sqrt[3]{19^2}}{3}\nonumber \\     &\beta_{3}=\frac{1+\varepsilon^2\sqrt[3]{19}+\varepsilon\sqrt[3]{19^2}}{3}\nonumber      \end{align}}     \end{tabular}     \end{center}     \end{document}      and I get this ![enter image description here](http://i.stack.imgur.com/nvLf9.jpg) How can I align all beta's horizontally with alpha's?


title: Workflow for converting LaTeX into Open Office / MS Word Format

text: I often have to write up reports based on the analysis of some data. I use R to analyse the data and export tables, figures, and text. This is then included into a LaTeX document either using `input` or Sweave (see here for details). However, when I collaborate with others, I sometimes need to provide a document in Open Office / MS Word format. **Question:** Thus, assume the simplest scenario   * I have a LaTeX document with text, tables, and figures   * I need to export this reliably into Open Office or MS Word format: this includes mathematical formulas, table formatting, and quality figures)   * I don't need to go back from MS Word to LaTeX What is a reliable, efficient, and preferably free process? **Initial Thoughts:**   * Export to HTML,   * OOoLatex   * LaTeX - LyX - ODF   * Use odfWeave   * I also just saw this earlier question that deals with some specific issues associated with LaTeX to Open Office conversion   * I've also found this question about LaTeX to Word for resumes I was hoping that there is an expert out there who has worked out a good system already.


title: Latex to Word conversion

text: My department expects me to write my masters dissertation in MS Word (which is just silly I know). I however want to use Latex and then just convert the entire document to word afterwards, as I think the department just wants the word version for it's archive, I doubt if they will mind if I hand in a Latex formatted document as a final submission. Are there options of converting from Tex to Word?


title: How to prepare my LaTeX based book for Word based proof reading?

text: > **Possible Duplicate:**   >  Workflow for converting LaTeX into Open Office / MS Word Format I am making a book using `memoir` and I am planning to try a proof reading service that uses Word. Does anyone have experience with such a set up, how would I go about doing it? I suppose it would be two main issues:   * Conversion to Word      * I have heard about tools for converting from pdf to Word. Is this a good idea? Should I do something special with the pdf before attempting such a tool (at least I guess removing the trim frames is a must?) and is there such a tool that does a better job than any other? Will they handle images?     * There are probably scripts for going from tex source to RTF but how well are they at handling references and bibliographies? And which one would be best for preparing a proof reading base?   * Conversion from Word      * I suppose I will have to this manual by adding each change to my source files one at a time. Or can anyone think of something else? I realise this looks like many questions but what I am hoping for is that someone can share their thoughts on it or even better their experiences!


title: LaTeX to Word converter

text: > **Possible Duplicate:**   >  Workflow for converting LaTeX into Open Office / MS Word Format What ways can you convert a LaTeX file to a Word document? What resources/articles exist to help get this done?


title: Is there a way to convert latex to msword?

text: > **Possible Duplicate:**   >  Workflow for converting LaTeX into Open Office / MS Word Format Is there a way to convert a full latex file to the Microsoft Word readable format? Yes, I hate word too, but unfortunally my monograph was recused becuase is out of the university rules and I need urgently put it in this format. Unfortunally, copy and past all text is very hard because it has several formulas. Anyone knows a good way to solve this? Or in particular, anyone know how to convert a latex formart to msword format? I will try convert a pdf to word, but I don't know I can use this well. If someone have a idea I would like to know. Appreciate the help, thx.


title: compile a .tex file to Word document?

text: > **Possible Duplicate:**   >  Workflow for converting LaTeX into Open Office / MS Word Format Are there any solutions to this? I know that's probably not the most favorable thing to do... But I really want to be able to give the document to someone, and they would need it in Microsoft word. There is something called latex2rtf (that's the closest thing I could find), but it segfaults and is very unstable. It does not produce well-formed files for my document or even subsets of my document. Any help appreciate.


title: How to convert a scientific manuscript to MS Word for a coauthor review

text: > **Possible Duplicate:**   >  Workflow for converting LaTeX into Open Office / MS Word Format I am a scientist and an (almost) average Windows 7 user. I like to use LaTeX (MikTeX with Texmaker) to write documents that do not go for a peer-review. Unfortunately, LaTeX is not very commonly used in my field of science. I have been writing my manuscripts in MS Word, because my coauthors can't use the MS Word's Track Changes feature on pdf files. Yet, I haven't given away the dream of writing also my manuscripts with LaTeX. So far I have been trying to find an efficient way to convert my documents to .doc format without a success. I am aware of many treads (1, 2, etc) discussing about this topic, but yet there seems to be a lack of an efficient solution for me. I have been trying to use Pandoc and htlatex. Both of them have managed to convert some features, but not all of what I need (natbib seems to be a major problem). I can't believe that there wouldn't be a solution for this, since the Open Source world is full of brilliant solutions nowadays. Thus I would like to ask help in making a workflow for converting this Latex document, which includes features from an average manuscript, into .docx format:               \documentclass[a4paper,12pt]{scrartcl}     \usepackage[sort]{natbib}     \bibliographystyle{authordate1}     \usepackage{setspace}     \setstretch{2}          \usepackage[pdftex]{graphicx}     \usepackage{lineno}     \usepackage{natbib}     \usepackage{authblk}     \usepackage[colorlinks=true,                   linkcolor=blue]{hyperref}          \title{This is a manuscript}     \author[1]{John Rambo}     \author[1,2]{Face Macfaen}     \author[3]{Pure Animal}          \affil[1]{Institute of Handicapped Maniacs}     \affil[2]{Cap headed taxi drivers}     \affil[3]{University of Gottemham, UK}          \date{\today}          % Define some names          \def\GM{{\it Gadus morhua}}            \begin{document}     \maketitle          \section*{Abstract}               We did some math\footnote{Which was borrowed from a Pandoc example, of course}     \[     \phi_n(\kappa) =      \frac{1}{4\pi^2\kappa^2} \int_0^\infty      \frac{\sin(\kappa R)}{\kappa R}      \frac{\partial}{\partial R}      \left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR     \]          We found out nothing, but that's how science is sometimes. We also cited a lot to pretend that we know something. \citet{Medina-Elizalde2012} talks about a collapse. R \citep{Team2011} is really the coolest program. \LaTeX does not work for manuscript writing, because some co-authors want to use track changes in MS Word.           \section*{Introduction}     \linenumbers     Plagiarized text: Pandoc is a \href{http://www.haskell.org/}{Haskell} library for     converting from one markup format to another, and a command-line tool     that uses this library. It can read     \href{http://daringfireball.net/projects/markdown/}{markdown} and     (subsets of) \href{http://redcloth.org/textile}{Textile},     \href{http://docutils.sourceforge.net/docs/ref/rst/introduction.html}{reStructuredText},     \href{http://www.w3.org/TR/html40/}{HTML}, and     \href{http://www.latex-project.org/}{LaTeX}; and it can write plain     text, \href{http://daringfireball.net/projects/markdown/}{markdown},     \href{http://docutils.sourceforge.net/docs/ref/rst/introduction.html}{reStructuredText},     \href{http://www.w3.org/TR/xhtml1/}{XHTML},     \href{http://www.w3.org/TR/html5/}{HTML 5},     \href{http://www.latex-project.org/}{LaTeX} (including     \href{http://www.tex.ac.uk/CTAN/macros/latex/contrib/beamer}{beamer}     slide shows), \href{http://www.pragma-ade.nl/}{ConTeXt},     \href{http://en.wikipedia.org/wiki/Rich\_Text\_Format}{RTF},     \href{http://www.docbook.org/}{DocBook XML},     \href{http://opendocument.xml.org/}{OpenDocument XML},     \href{http://en.wikipedia.org/wiki/OpenDocument}{ODT},     \href{http://www.microsoft.com/interop/openup/openxml/default.aspx}{Word     docx}, \href{http://www.gnu.org/software/texinfo/}{GNU Texinfo},     \href{http://www.mediawiki.org/wiki/Help:Formatting}{MediaWiki markup},     \href{http://www.idpf.org/}{EPUB},     \href{http://redcloth.org/textile}{Textile},     \href{http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff\_man.7.html}{groff     man} pages, \href{http://orgmode.org}{Emacs Org-Mode},     \href{http://www.methods.co.nz/asciidoc/}{AsciiDoc}, and     \href{http://www.w3.org/Talks/Tools/Slidy/}{Slidy},     \href{http://paulrouget.com/dzslides/}{DZSlides}, or     \href{http://meyerweb.com/eric/tools/s5/}{S5} HTML slide shows. It can     also produce \href{http://www.adobe.com/pdf/}{PDF} output on systems     where LaTeX is installed. (Taken from Pandoc manual).          \section*{Material and Methods}          \GM~ is a cod.          \section*{Results}          Table \ref{numbers} shows more of this boring stuff, but that's how science often is. Figure \ref{figure} is a pdf challenge for Pandoc. If it works, I'll eat my hat.          \begin{figure}[h!]      \centering      \includegraphics[scale=.7]{figure.pdf}     \caption{Figure shows some dull scientific stuff that confuses Pandoc. It's made with R and imported in pdf format. X-axis has unit of $\mu m \ s^{-1} $}     \label{figure}     \end{figure}          \newpage     \bibliography{example}               \section*{List of tables}          \input{numbers.tex}               \end{document}      Here is numbers.tex, which is needed to run the code.               % latex table generated in R 2.12.1 by xtable 1.5-6 package     % Sun May 29 13:02:18 2011     \begin{table}[ht]     \begin{center}     \caption{Distribution of samples over year, stage, age, sex and month}     \begin{tabular}{rrrrrrrrrrr}       \hline      & 1997 & 1998 & 2004 & 2005 & 2006 & 2007 & 2008 & 2009 & 2010 & Total \\        \hline     1 & 0 & 0 & 0 & 0 & 0 & 7 & 15 & 35 & 16 & 73 \\        2 & 28 & 11 & 34 & 138 & 102 & 50 & 37 & 29 & 85 & 514 \\        3 & 0 & 0 & 0 & 0 & 0 & 2 & 0 & 0 & 0 & 2 \\        4 & 28 & 11 & 34 & 138 & 102 & 57 & 52 & 64 & 101 & 587 \\        5 & 28 & 7 & 26 & 125 & 58 & 55 & 40 & 62 & 73 & 474 \\        6 & 0 & 3 & 5 & 8 & 42 & 2 & 11 & 2 & 28 & 101 \\        7 & 0 & 1 & 3 & 5 & 2 & 2 & 1 & 0 & 0 & 14 \\        8 & 28 & 10 & 31 & 133 & 100 & 57 & 51 & 64 & 101 & 575 \\        9 & 4 & 2 & 14 & 43 & 27 & 28 & 20 & 7 & 40 & 185 \\        10 & 0 & 3 & 5 & 8 & 42 & 2 & 11 & 2 & 28 & 101 \\        11 & 10 & 5 & 11 & 71 & 19 & 24 & 12 & 11 & 29 & 192 \\        12 & 14 & 1 & 4 & 16 & 14 & 5 & 9 & 44 & 4 & 111 \\        13 & 14 & 10 & 30 & 122 & 88 & 54 & 43 & 20 & 97 & 478 \\        14 & 0 & 0 & 0 & 0 & 0 & 2 & 2 & 0 & 9 & 13 \\        15 & 0 & 0 & 0 & 0 & 0 & 5 & 9 & 11 & 5 & 30 \\        16 & 21 & 8 & 24 & 98 & 93 & 25 & 31 & 46 & 57 & 403 \\        17 & 7 & 3 & 5 & 38 & 9 & 25 & 10 & 7 & 28 & 132 \\        18 & 0 & 0 & 5 & 2 & 0 & 2 & 0 & 0 & 2 & 11 \\        19 & 28 & 11 & 29 & 136 & 102 & 57 & 52 & 64 & 99 & 578 \\         \hline     \end{tabular}     \label{numbers}     \end{center}     \end{table}      Here is the bibliography (example.bib):               % This file was created with JabRef 2.7.2.     % Encoding: Cp1252          @ARTICLE{Medina-Elizalde2012,       author = {Medina-Elizalde, M. and Rohling, E. J.},       title = {Collapse of Classic Maya Civilization Related to Modest Reduction         in Precipitation},       journal = {Science},       year = {2012},       volume = {335},       pages = {956-959},       number = {6071},       endnotereftype = {Journal Article},       issn = {0036-8075 1095-9203},       shorttitle = {Collapse of Classic Maya Civilization Related to Modest Reduction         in Precipitation}     }          @MISC{Team2011,       author = {R Development Core Team},       title = {R: A Language and Environment for Statistical Computing},       howpublished = {R Foundation for Statistical Computing},       year = {2011},       endnotereftype = {Electronic Source},       shorttitle = {R: A Language and Environment for Statistical Computing},       url = {http://www.R-project.org}     }      Here is the figure (figure.pdf) ![enter image description here](http://i.stack.imgur.com/82bcN.png) * * * Ok, I have tried several of these options. Here is a list what some of these multiple options given here do and do not convert (please edit, if you find mistakes / additions): **Pandoc** Converts   * Math   * Text   * Headings Does not convert   * Tables   * Pdf figures   * natbib references   * Hyperlinks and cross references   * Author list **GrindEQ** Converts   * Math   * Tables   * Cross-references   * Text   * Headings Does not convert   * \maketitle (with author list)   * Pdf figures   * Url's   * natbib reference list Adds unnecessary space after special commands and url's **Adobe Acrobat X Pro** Converts   * Almost everything Does not convert   * Hyperlinks (but they are really not needed either)   * Maths (or does convert them, but not perfectly) Best option so far, but makes the font look weird in Word. I can't find a way changing it to normal. **PDF annotation** The community seems to think that this is by far the best option. I do agree, but as said some of the more experienced coauthors insist to have their doc version. Thus this is not a solution for this question. Mendeley was suggested as the best pdf annotation / reference manager program. If you haven't heard about this program, go and check it out. It seems very promising.


title: Extracting Text Only from a Thesis

text: The question Extracting the contents of text in a specified environment into a new file (and answers therein) involve using the `extract` package to produce a LaTeX file that contains all the text within in a specified environment. My question is if it is possible to do the reverse? I am forced to work with Microsoft Word users. Due to Word's stability issues we usually maintain a `.docx` file containing all the text for a paper (or in this case my thesis) and one containing all of the figures and captions. Some journals require this approach as well. The `endfloat` package gets part of the way there by placing figures at the end of the PDF that is generated. I've had trouble using `TeX4ht` or `latex2rtf` because all of my figures are PDF. Figures in PDF format work great with `pdftex`, which I use to generated the PDF files. Being a chemist, I use a lot of superscripts and subscripts, in particular with the `mhchem` package. I was hoping that if I could the text into HTML or RTF I could import to word without have to redo every subscript and superscript in the text. I've tried placing all of the `\includegraphics` commands within a comment environment (like `textonly` below) using the `comment` package:               \begin{figure}     \begin{textonly}     \centering     \includegraphics{figurefile}     \end{textonly}     \label{fig:figure}     \end{figure}      This approach broke all of my references (`\ref{fig:figure}`) to figures - they typeset as `??`. Is finding a way to compile the LaTeX code into a more Word friendly format the way to go or is converting the PDF generated by `pdftex` the best approach? I find that I have to manually fix the subscripts and superscripts to be recognized by Word. Additionally, all of the `\ref`s work in the final output PDF, where that may be a problem in a split file approach.


title: From .tex to .doc format. Is it possible?

text: > **Possible Duplicate:**   >  Workflow for converting LaTeX into Open Office / MS Word Format sorry, this can be a stupid question... My teacher wants a `.doc` file and I wrote my work in LaTeX. Is it possible to export a `.tex` format file to a `.doc` one? (Without the copy-paste method obviously)


title: LaTeX and Word - how to convert

text: One of our chemistry professors asked us to convert our LaTeX document into PDF, because it's easier for him to correct the document that way. I just thought it was impossible to convert Word to LaTeX and LaTeX to Word - but he is a professor on "Science an Technology" so I think he should know what LaTeX is. So is their any possibilty to create a Word document of LaTeX?


title: Convert a latex document with lots of equations and pseudocode to Microsoft Word

text: I have a nice latex document with a lot of mathematical equations and pseudoalgorithms. Now I need to work out this document with a colleague that can only use microsoft word. So I need to convert everything to word. I thought about using latex2html, but then I lose pseudoalgorithms and equations since they are converted as images. Could you suggest a better way of doing this?


title: How to uncover alternating row colors in beamer class?

text: In the howtos section of the beamer documentation (v3.30) I saw the code how to do alternating row colors when displaying tables as a remedy to errors caused by horizontal and vertical lines in tables.   Unfortunately, the code was with errors in my case. I noticed that the `\rowcolors` macro in the documentation is not mentioned in the `colortbl` package documentation by David Carlisle on 2012/02/13. Code as in the `beamer` class documentation:               \documentclass{beamer}     \usepackage{colortbl}      \usepackage{booktabs}     \usepackage{graphicx,xcolor}     \begin{document}     \begin{frame}     \rowcolors[]{1}{blue!20}{blue!10} % \rowcolors is not in the colortbl manual     \begin{tabular}{l!{\vrule}cccc} % what's the idea behind !\vrule here, can we avoid it?     Class & A & B & C & D \\\midrule % \midrule instead of the old \hline     X & 1 & 2 & 3 & 4 \pause\\     Y & 3 & 4 & 5 & 6 \pause\\     Z & 5 & 6 & 7 & 8 \\ % double backslash was added as it was not there in the manual     \end{tabular}     \end{frame}     \end{document}         The error thrown:               Undefined control sequence \end{frame}        **Questions:**   What am I missing here? How to fix this error?   What is the best practice to have alternating colors in `beamer` class via cleaner lines of code? Your answers will be much appreciated.


title: Caveats of newtxmath and fontspec together

text: I'm able to typeset a ~50 page set of lecture notes with heavy math using               \usepackage{libertine}     \usepackage[libertine]{newtxmath}      with both PDFLaTeX and XeLaTeX. I know that the `libertine` package automatically loads and uses `fontspec` if used with XeTeX. However, someone here mentioned that it's not a good idea to use Type1 and OpenType fonts together. So, what could go wrong?


title: Undefined control sequence ``\let`` in ``hyperref`` included after ``unicode-math``

text: Consider the following document:               \documentclass{article}          \usepackage{unicode-math}     \usepackage{hyperref}          \begin{document}     aaa     \end{document}      When I compile it with `lualatex`, I get the following error:               ! Undefined control sequence.     <argument> \Url@FormatString           l.5037 \let              \HyOrg@url\url     ?       If I put `hyperref` before `unicode-math`, I get a different error:               ! Undefined control sequence.     <argument> \Url@FormatString           l.2317 }      The strange part is, the first document (more complicated one to be exact, the one I've reduced to this example) worked for me just yesterday. I have not updated any part of the system; I tried reverting back to previous commits and that did not help either. Does anyone know what can cause this problem? System details:   * OSX 10.8.5   * TexLive 2013   * luatex r30581, hyperref r28213, unicode-math r30504 Edit: the result of `\listfiles`:                article.cls    2007/10/19 v1.4h Standard LaTeX document class       size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)     unicode-math.sty    2013/05/04 v0.7e Unicode maths in XeLaTeX and LuaLaTeX      ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)        expl3.sty    2013/07/28 v4582 L3 Experimental code bundle wrapper      l3names.sty    2012/12/07 v4346 L3 Namespace for primitives     l3bootstrap.sty    2013/07/28 v4581 L3 Experimental bootstrap code       luatex.sty    2010/03/09 v0.4 LuaTeX basic definition package (HO)     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)     luatex-loader.sty    2010/03/09 v0.4 Lua module loader (HO)     pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)      ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)        ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)     l3basics.sty    2013/07/28 v4581 L3 Basic definitions      l3expan.sty    2013/07/24 v4565 L3 Argument expansion         l3tl.sty    2013/07/28 v4581 L3 Token lists        l3seq.sty    2013/07/28 v4581 L3 Sequences and stacks        l3int.sty    2013/07/28 v4581 L3 Integers      l3quark.sty    2013/07/21 v4564 L3 Quarks        l3prg.sty    2013/07/28 v4581 L3 Control structures      l3clist.sty    2013/07/28 v4581 L3 Comma separated lists      l3token.sty    2013/07/28 v4581 L3 Experimental token manipulation       l3prop.sty    2013/07/28 v4581 L3 Property lists        l3msg.sty    2013/07/28 v4581 L3 Messages       l3file.sty    2013/07/28 v4581 L3 File and I/O operations       l3skip.sty    2013/07/28 v4581 L3 Dimensions and skips       l3keys.sty    2013/07/28 v4581 L3 Experimental key-value interfaces         l3fp.sty    2013/07/09 v4521 L3 Floating points        l3box.sty    2013/07/28 v4581 L3 Experimental boxes     l3coffins.sty    2012/09/09 v4212 L3 Coffin code layer      l3color.sty    2012/08/29 v4156 L3 Experimental color support     l3luatex.sty    2013/07/28 v4581 L3 Experimental LuaTeX-specific functions     l3candidates.sty    2013/07/24 v4576 L3 Experimental additions to l3kernel       xparse.sty    2013/07/28 v4582 L3 Experimental document command parser     l3keys2e.sty    2013/07/28 v4582 LaTeX2e option processing using LaTeX3 keys     fontspec.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX     luaotfload.sty    2013/07/23 v2.3b OpenType layout system     luatexbase.sty    2013/05/11 v0.6 Resource management for the LuaTeX macro progr     ammer     luatexbase-compat.sty    2011/05/24 v0.4 Compatibility tools for LuaTeX     luatexbase-modutils.sty    2013/05/11 v0.6 Module utilities for LuaTeX     luatexbase-loader.sty    2013/05/11 v0.6 Lua module loader for LuaTeX     luatexbase-regs.sty    2011/05/24 v0.4 Registers allocation for LuaTeX     luatexbase-attr.sty    2013/05/11 v0.6 Attributes allocation for LuaTeX     luatexbase-cctb.sty    2013/05/11 v0.6 Catcodetable allocation for LuaTeX     luatexbase-mcb.sty    2013/05/11 v0.6 Callback management for LuaTeX     fontspec-patches.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX          fixltx2e.sty    2006/09/13 v1.1m fixes to LaTeX     fontspec-luatex.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX      fontenc.sty       eu2enc.def    2010/05/27 v0.1h Experimental Unicode font encodings       eu2lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern     xunicode.sty    2011/09/09 v0.981 provides access to latin accents and many othe     r characters in Unicode lower plane      eu2lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     fontspec.cfg     catchfile.sty    2011/03/01 v1.6 Catch the contents of a file (HO)     etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)       fix-cm.sty    2006/09/13 v1.1m fixes to LaTeX       ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file     filehook.sty    2011/10/12 v0.5d Hooks for input files     unicode-math-luatex.sty         lualatex-math.sty    2013/08/03 v1.3 Patches for mathematics typesetting with Lu     aLaTeX     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX     unicode-math-table.tex     hyperref.sty    2012/11/06 v6.83m Hypertext links for LaTeX     hobsub-hyperref.sty    2012/05/28 v1.13 Bundle oberdiek, subset hyperref (HO)     hobsub-generic.sty    2012/05/28 v1.13 Bundle oberdiek, subset generic (HO)       hobsub.sty    2012/05/28 v1.13 Construct package bundles (HO)       ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)      intcalc.sty    2007/09/27 v1.1 Expandable calculations with integers (HO)     kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)     kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)     pdfescape.sty    2011/11/25 v1.13 Implements pdfTeX's escape features (HO)     bigintcalc.sty    2012/04/08 v1.3 Expandable calculations on big integers (HO)       bitset.sty    2011/01/30 v1.1 Handle bit-vector datatype (HO)     uniquecounter.sty    2011/01/30 v1.2 Provide unlimited unique counter (HO)     letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)      hopatch.sty    2012/05/28 v1.2 Wrapper for package hooks (HO)     xcolor-patch.sty    2011/01/30 xcolor patch     atveryend.sty    2011/06/30 v1.8 Hooks at the very end of document (HO)     atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)     refcount.sty    2011/10/16 v3.4 Data extraction from label references (HO)      hycolor.sty    2011/01/30 v1.7 Color options for hyperref/bookmark (HO)      auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)     kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)       pd1enc.def    2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)     hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive          url.sty    1999/03/02  ver 1.4  Verb mode for urls, email addresses, and fi     le names      hpdftex.def    2012/11/06 v6.83m Hyperref driver for pdfTeX     rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)        t3cmr.fd    2001/12/31 TIPA font definitions     supp-pdf.mkii     epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf       grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)     epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live      nameref.sty    2012/10/27 v2.43 Cross-referencing by name of section     gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)     smallcaps.out     smallcaps.out


title: Can one create a two-part spacing command?

text: I would like to create a two-part spacing command. Specifically, I'd like two commands: `\mySpaceOne` and `\mySpaceTwo`. If `\mySpaceOne` is followed by a `\mySpaceTwo`, then it generates a certain amount of space; otherwise, it does nothing and does not consume the next token. Is this possible? How would one begin to create such a command?


title: What is the preferred method for specifying type families, after loading a font package?

text: I'm confused about the methods used to specify fonts using when more than one package is potentially involved. I understand that packages configure a variety of settings by default, and that different packages support different options (giving different degrees of control over these settings), but is there a general rule or best practice? For example, once I've loaded a package for the serif font, what is the difference between then using               \usepackage[scaled]{beramono}      and               \renewcommand{\ttdefault}{fvm}      to select the typewriter font? The implication of some documentation I've read (e.g., `mathdesign`, 4.3) is that that packages may do some things to ensure that the "low level" way of specifying additional families will work smoothly with that package. So, once I've loaded one package, is it better to specify subsequent fonts using the second approach above, or the first?


title: Add offset to line number (in error message) when using input files

text: I am compiling a latex document, and when I have errors, I get nice messages like               l.1041 \end{frame}      which tells me that there is an error somewhere before line 1041. So far, so good. I can use my text editor and quickly find line 1041. But sometimes I have a latex document (say, `main.tex`) that includes something like               \input{../my_headers}      at the beginning of the file. Now if latex tells me there is an error on line 1041, it is referring to the source code consisting of `main.tex` with `my_headers.tex` inserted into it. So if I edit the actual file `main.tex`, line 1041 doesn't correspond to the error location. The location I want is 1041 minus the number of lines in `my_headers.tex`. So, I can manually calculate it, or make a script, but it seems like there must be a simple option to tell latex to ignore the input/include files when calculating line numbers. Any ideas?


title: Making a LaTeX document appear as though it were typeset in MS Word

text: I am typesetting a document in LaTeX for which I have been given exact specifications that are intended for an MS Word-processed document (single- sided, single-spaced, 0.75 inch margins, no more than 60 lines per page, no more than 15 characters per inch (including punctuation, spaces, and symbols), 12 point Arial or Helvetica). I need to adhere rigorously to these guidelines and to make the document look reasonably "Word-like". I have little experience setting these parameters in LaTeX as the default typesetting scheme is nearly always satisfactory. I've been a bit overwhelmed by the degrees of freedom available in LaTeX; for instance, to set margins with the `geometry` package, the parameters that can be defined include hscale, vscale, width, height, lines, left, right, top, bottom, hmargin, vmargin, etc., and it is not entirely apparent which of these settings will give 1 inch marigns as defined by MS Word. The following settings represent my initial attempt to ensure rigid conformity to the specified guidelines:                   \documentclass[12pt]{article}         \usepackage[tmargin=0.75in,bmargin=0.75in,lmargin=0.75in,rmargin=0.75in]{geometry}         \renewcommand{\rmdefault}{phv}         \renewcommand{\sfdefault}{phv}      Could anyone tell me if the above are good solutions to margins, font face (Arial), and font size (12 pt)? I do not know if LaTeX 12 pt is equivalent to Word 12 pt -- I have read that the two metrics are non-equivalent. I do not know how to ensure the requirements for cpi (without verifying with a ruler), lines per page (without counting), or single spacing (this implies Word- defined single spacing). Lastly I wish to avoid the large size of and whitespace surrounding section headers. Essentially, I need to typeset a document that looks Word-like, but do not have Word nor do I wish to use it.. I would appreciate guidance on how to typeset my document. The ideal solution would be specific enough to this question that I successfully meet the aforementioned guidelines, and general enough that others who have a similar question in the future are able to adapt the response to their own formatting requirements. Cheers.


title: Are there macros that behave like \pdfximage and \pdflastximagepages but can be compiled with XeLaTeX?

text: The following code can be compiled with `pdflatex` but not `xelatex`.               \documentclass{article}     \usepackage{graphicx,multido}     \begin{document}     \pdfximage{something.pdf}     \multido{\i=1+1}{\the\pdflastximagepages}{%         \fbox{\includegraphics[page=\i,scale=0.25]{something}}         \endgraf     }     \end{document}      The idea is to include each page of `something.pdf` as a separate image. I don't want to use `pdfpages` package and I want to use `xelatex`. Are there macros that behave like `\pdfximage` and `\pdflastximagepages` but can be compiled with XeLaTeX?


title: Multiple columns enumeration with automatically determined column numbers

text: From this answer, I have known how to write multiple columns enumeration. But is it possible to automatically determine column numbers according to the maximal widths of all items, rather than manually specify the column number?


title: Difference between bookmark levels greater than one - what does this mean?

text: When compiling my LaTeX file, I received this warning message. Though I got the PDF file, I still want to know why this warning comes and how to fix it. It occurs in this line.               \paragraph{Plane stress} Plane state of stress, a.k.a. plane stress, is a state of stress in which\[\sigma_{33}=\sigma_{31}=\sigma_{32}=0.\]      * * *               Warning: Difference (2) between bookmark levels is greater(hyperref) than one,     level fixed on input line 97. Difference (2) between bookmark levels     is greater(hyperref) than one, level fixed.      The question may be seemed dummy to some TeX experts, but as a newbie here, I really don't know how it comes. I attempt to write two subsubsections, but without numbering them. So I choose the command `\paragraph`. Is there any work-arounds?


title: How to improve on this "twolines" decoration?

text: I'm typesetting an article on graphical calculus in tensor categories in TikZ and I wanted to define a decoration that draws two parallel lines at the same time. Here is my first try:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{decorations}     \usetikzlibrary{calc}     \usetikzlibrary{knots}     \usepgfmodule{decorations}          \begin{document}         \pgfdeclaredecoration{twolines}{initial}         {             \state{initial}[width=2pt]             {                 \pgfpathmoveto{\pgfpoint{0pt}{1pt}}                 \pgfpathlineto{\pgfpoint{2pt}{1pt}}                 \pgfpathmoveto{\pgfpoint{0pt}{-1pt}}                 \pgfpathlineto{\pgfpoint{2pt}{-1pt}}                 \pgfpathmoveto{\pgfpoint{0pt}{0pt}}             }         }         \tikz[decoration=twolines]{             \coordinate (T) at (0.6,0);             \coordinate (N) at (0,0.2);             \draw[decorate,knot=black] (T) to[out=-90,in=-90] (N) -- (0,1);             \draw[decorate,knot=black] (0,-1) node[below] {$X \otimes Y$} -- ($(0,0)-(N)$) to[out=90,in=90] (T);         }     \end{document}      ![enter image description here](http://i.stack.imgur.com/N55Ua.png) As you can see, it kind of works, but it's not ideal. The individual line segments should be connected, and ideally, curved. I could just decrease "width" to a ridiculously short length (say 0.1pt), but that seems to slow big pictures down a lot. Is there a nicer way to fix the problems? Edit: I tried percusse's excellent suggestion to just use the "double" option, which is probably very fast and doesn't even need decorations. However, it seems that it doesn't play well with the "knots" library. Combining "double" and "knot=black" seems to overwrite the "double" option. Edit 2: My question is about tikz decorations and not about general ways to draw my diagram, _especially none including pstricks_. Edit 3: Workarounds for my particular example aren't very interesting since it's easily done in TikZ or with other libraries. I'm interested in writing a good decoration.


title: Does a symbol for "married" exist in some package or font?

text: I would like to write something like `Bride-name \rings{} groom-name` in my text and wonder, if a symbol for rings already exist. Maybe somewhere around the symbols for "born" or "deceased" or other formal symbols such a two-rings symbol exist. I am looking for two rings, horizontally aligned and intersecting each other. I guess, a knot-like behaviour as seen here would be nice, in order to distinguish it from `\infty` or similar. Here is some code to play around with. I tried using the Olympic rings, but failed. But I guess, someone knows a symbol which is already written.               \documentclass[twoside=true, paper=A5]{scrartcl}     \usepackage{fontspec}     \defaultfontfeatures{%         ,Ligatures={TeX}     }     \setmainfont{EB Garamond}     \addtokomafont{disposition}{\rmfamily}     \usepackage[final]{microtype}     \usepackage{luatextra}     \usepackage[cmyk]{xcolor}     \usepackage{polyglossia}     \setdefaultlanguage[spelling=new, babelshorthands=true]{german}     \usepackage{tikz}          \definecolor{Front}{rgb}{0.85,0.8627,0.839}     \definecolor{Schrift}{rgb}{0.31,0.31,0.34}          \makeatletter     \newcommand{\globalcolor}[1]{%       \color{#1}\global\let\default@color\current@color     }     \makeatother          \AtBeginDocument{\globalcolor{Schrift}}          \title{Bride-name \begin{tikzpicture}          \path[draw=white,line width=.08cm,          fill=Schrift,even odd rule]          (1, 0) circle (0.18cm)          (1, 0) circle (0.05cm);          \path[draw=white,line width=.08cm,          fill=Schrift,even odd rule]          (1.2, 0) circle (0.18cm)          (1.2, 0) circle (0.05cm);     \end{tikzpicture} Groom-name}     \date{}          \begin{document}     \pagecolor{Front}     \maketitle     \thispagestyle{empty}     \end{document}


title: thmtools and mdframed (vertical space)

text: I dont know why I dont get the two examples closer together. How can I achieve a spacing of 0mm between the two Examples?                   %!TEX TS-program = XeLaTeX     %!TEX encoding = UTF-8 Unicode               % DEFINITIONS ===================================================     \documentclass[         12pt,         a4paper,         twoside,         headings=normal,         titlepage=true     ]{scrreprt}               \usepackage{xparse}          \usepackage{tikz}     \usetikzlibrary{calc}               % Math     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage[centertags]{amsmath}          \usepackage[framemethod=TikZ]{mdframed}     % Emphasize     \usepackage[]{empheq}     % \RequirePackage[hyperref,thref,amsmath]{ntheorem}     \usepackage{amsthm}     \usepackage{thmtools}          \usepackage{lipsum}                    \declaretheoremstyle[%             headfont=\bfseries, %             notebraces={(}{)},%             bodyfont=\normalfont,%             notefont=\itshape,%             headpunct={:},%             postheadspace=\newline,%             postheadhook={}, %{\textcolor{red}{\rule[.6ex]{\linewidth}{0.4pt}}\\},%             spacebelow=0\parsep,%             spaceabove=0\parsep,             mdframed={%               linecolor=black,%               leftline=false,%               rightline=false,%               topline=true,%               bottomline=true,%               middlelinewidth=1pt,%               innertopmargin=0.0\baselineskip,%               innerbottommargin=0.0\baselineskip,%               innerleftmargin=0pt,%               innerrightmargin=0pt,%               skipbelow=0pt,%               skipabove=0pt%             }%%     ]{myFramedDefinitionStyle}%          \declaretheorem[         style=myFramedDefinitionStyle,         name=Definition,         numberwithin=chapter     ]{definition1}          % Basic Command     \ExplSyntaxOn         \NewDocumentEnvironment{definition} { o o }          {%           \IfNoValueTF{#1} {\begin{definition1}}{ \begin{definition1}[#1] }%                                             \IfNoValueTF{#2} {}{\label{#2}}%          }%          {%           \end{definition1}%          }%     \ExplSyntaxOff               \begin{document}          \begin{definition}[asd]     asdasd     \end{definition}          \begin{definition}[asd]     asdasd     \end{definition}     \end{document}      Here the image: ![enter image description here](http://i.stack.imgur.com/zcCyd.png)


title: Randomly assign background colour for each frame

text: How can a randomly picked background colour be chosen for each beamer frame? ## Note: This question is asked to round out the question Randomly assign color to background in the PDF whenever page is turned which asks for a solution which alters the colour when the `pdf` is displayed. On contrast the present question deals with randomly assigning colours during compilation.


title: Why and since when does \mathrm render ligatures?

text: As explained in answer to this question and several others as well as in various other ressources, `\mathrm` is for setting upright math symbols (and may thus cause problems when used for text). So if, for whatever reason, I denote something with an upright f and something else with an upright i and want to multiply the two, `\mathrm{fi}` or `\mathrm{f}\mathrm{i}` should do the job and especially not employ any ligatures. ~~While I am rather sure that the above statement was correct not too long ago,~~ my current distribution (TeX Live 2012) as well as this tool renders a ligature: ![<code>\\mathrm{f}\\mathrm{i}</code>](http://1.618034.com/blog_data/math/formula.29680.png) Why? And when did this change? Or am I mistaken about this? (Note that I am not looking for a way to avoid this.) * * * Minimal example:               \documentclass{article}     \begin{document}     \[ \mathrm{f}\mathrm{i} \]     \end{document}


title: Drawing on an image with TikZ

text: Recently I have learned how to draw simple stuff with TikZ. I really like it. Now I wonder if it is possible to draw with TikZ on a image. Instead of pasting a image in Illustrator and adding some vectors to point something in the picture I would like to do it using TikZ. Is it possible? For example, on a picture of a computer (PNG,etc) I would like to draw some arrows and labels saying "Keyboard", "Monitor", etc.


title: How to put text in an existing figure/image (maybe with tikz?)

text: > **Possible Duplicates:**   >  Drawing on an image with TikZ   >  How to superimpose LaTeX on a picture? I was wondering if it's possible to have an existing image (possibly in a figure environment) and then add text at arbitrary locations within that image/figure. Does maybe Tikz allow something like that? For clarity: This wiki link has this synapse image with hyperlinks at the beginning of arrows that point to specific parts of the synapse. When clicking on the image I only see the png file and the hyperlinks disappeared and only arrows without description pointing to stuff so I would like to reintroduce these texts.


title: how to modify an in includegraphic image in latex

text: I include a PNG picture using the `\includegraphics` command and it looks like this: ![enter image description here](http://i.stack.imgur.com/rksDP.png) Would it be possible to modify it in LaTeX by including a legend and tick markers on the axis as well? Or a text box say next to a given plot?


title: Mathematical Symbols in Figure

text: How can I add mathematical symbols in figure or draw figure and put mathematical symbols on it?


title: Tikz Braces On Top of Image

text: I am trying to produce the following result: ![d](http://i.stack.imgur.com/gUwG6.png) I've never placed tikz objects on images. Any help would be appreciated.


title: draw on pdf file

text: I have such a case: I got one pdf file but it's read only,I wish to draw on it. so I think maybe I can do it as below: 1). embed origin.pdf into latex code as a picture. 2). find right position to draw on it. But I wish the new pdf file dimension exactly the same as origin one. I try below code, but it seems the original pdf file (8.5inx11.0in) has been cropped.               \documentclass{article}     \usepackage[paperwidth=8.50in, paperheight=11.00in]{geometry}     \usepackage{tikz}          \begin{document}          \tikzstyle{default}=[anchor=north west,draw=red,inner sep=0pt]     \begin{tikzpicture}[anchor=south west,inner sep=0pt, outer sep=0pt]     \node at (current page.south west) {         \begin{tikzpicture}[overlay,remember picture,inner sep=0pt, outer sep=0pt,anchor=south west]             \node[anchor=south west,inner sep=0,rotate=0] (image) at (0,0) {\includegraphics{origin.pdf}};         \end{tikzpicture}     };          \end{tikzpicture}          \end{document}      Not sure if it's the right one to do such tasks!


title: How to label images in Latex

text: ![enter image description here](http://i.stack.imgur.com/xgZGr.gif) The image has 2 labels (1) and (2) with red arrows Is it possible to do this in Latex or should I try something else to achieve similar result.


title: How to refer to a relative position within a node?

text: I've included an external image in a TikZ diagram as follows:               \node (A) {\includegraphics[width=4cm]{image.png}};      The image is 100x100 pixels, and I need to draw a path from pixel (64,32). Is there a way to refer to the position 64% from the left and 32% from the bottom inside the node?


title: Text over an inserted picture

text: How can I put text over a picture (.jpg, say) in a tex document? I have a graphic in my document as a .jpg:               \begin{figure}[ht!]     \centering     \includegraphics[scale=.4]{graphic_1.jpg}     \caption{The map $\phi_0$ }     \end{figure}       and I want to label certain parts of it with some mathematical symbols. I'd prefer to do this without tikz, but if someone has a solution using it, then that would be fine. Thanks.


title: How can I write text to a graphic?

text: > **Possible Duplicate:**   >  How to superimpose LaTeX on a picture? I want to write text to a graphic. Firstly I thought about the `wallpaper` package in combination with the `textpos` package. Do you know a better opportunity for me?


title: How to put text on top some image in tikz?

text: I have an image like this: ![enter image description here](http://i.stack.imgur.com/HddXP.jpg) Is there a way to put text on top of this image? I want some text like this: ![enter image description here](http://i.stack.imgur.com/Em76y.jpg)


title: How to add a scalebar to an image

text: I'm trying to figure out how best to add scale bars to my images, such as in these wondeful snowflake images (the full size image is a bit large, but it's the best example of what I'm trying to do): ![](http://i.stack.imgur.com/i8zpy.jpg) One possibility would be to insert the scale bars using a different program. However, I want to ensure the text is nice and crisp, rather than having it saved as part of a raster image. Also, if I insert the scale bars beforehand, then the text will get resized when LaTeX scales the images. So far I haven't been able to find any existing commands or packages that make this easy to do. I would like to be able to specify the real world size of the image, and have the size of the scale bar be calculated. If I have to write my own macro, I think I'll start with the overpic package Am I headed in the right direction? **EDIT 2:** After familiarizing myself with TikZ, here is the macro I've come up with:               \usepackage{tikz}     \usepackage{siunitx}          % Inserts a scale bar into an image     % Optional argument 1: the colour of the bar and text     % Argument 2: an \includegraphics command     % Argument 3: the real world width of the image     % Argument 4: the length of the scale bar     % Argument 5: the units in which the scale bar is measured     \newcommand{\scalebar}[5][white]{      \begin{tikzpicture}       \draw (0,0) node[anchor=south west,inner sep=0] (image) { #2 };       \begin{scope}[x={(image.south east)},y={(image.north west)}]        \fill [#1] (0.05,0.2cm) rectangle (#4/#3+0.05,0.4cm);        \draw [#1] (0.05,0.4cm) node[anchor=south west] { \SI{#4}{#5} };       \end{scope}      \end{tikzpicture}     }      I'm using a combination of units here (cm and fractions of the image size). I feel like this aspect could be a bit more elegant, but what I have now is sufficent for my purposes.


title: How to create magnified subfigures and corresponding boxes for portions of a large image

text: **Updated Below** I hope the title gets at what I'm trying to do. I have a large image for a thesis on an image processing topic, and I want show the large image, with zoomed in boxes (typically with the same aspect ratio). I also want colored frames overlaid on the large image to show what portions I'm magnifying. Here's an example: ![enter image description here](http://i.stack.imgur.com/XfhaR.jpg) I am currently accomplishing this by taking the large image and copying the desired zoomed areas into seperate images, and creating the overlaid frames, all in MATLAB. I then use the technique discussed in this previous question of mine to align all the images nicely. My new question is, can a similar end product be created entirely within LaTeX so that the only external file I need is the original large image, and some LaTeX component (I'm thinking Tikz, but open to suggestions) creates the overlaid frames and cropped/ zoomed copies of it, then either arranges them as shown in my example, or uses the technique here to align them nicely. Also, the example I showed is just a sample layout; ideally any solution would be flexible enough to allow rearrangement to some other reasonable arrangement, such as large image on top (full linewidth) with two or three zoom boxes in a horizontal line under it. Thanks. The image I'm working with is here: ![Art Gallery](http://i.stack.imgur.com/T5Ml0.jpg) **Update** Please see Jake's response below for current best/ complete version of code. The only outstanding item is that, while subcaptions work and can be referenced with `\subref{}`, the spy library processes the labels multiple times, resulting in a warning about multiply defined labels. As such, I have elected to not use subcaptions/ labels for now since the color-coding makes pretty clear the relationship between the zoomed images and the large one. The subcaptions can be removed by replacing the line `\newcommand\phantomimage{\subcaptionbox{\label{\pgfkeysvalueof{/tikz/subfigurename}}}{\phantom{\rule{\imagewidth}{\imageheight}}}}` with `\newcommand\phantomimage{\phantom{\rule{\imagewidth}{\imageheight}}}` I've started a separate question here about the multiply-defined labels with `spy` problem. I'll update this post again if any solution comes out of the new question. **Final Update** The subcaption issue has been resolved. Please see Jake's response below for final code and usage.


title: How to place arrows with captions pointing precisely to details inside of a picture?

text: > **Possible Duplicate:**   >  Drawing on an image with TikZ   >  How to create magnified subfigures and corresponding boxes for portions of > a large image I am a beginner in Latex, trying to use it for an industrial document. I need in one case to use the picture of a device, say looking as a round clock. I am looking at a way to add a number of arrows, pointing inside the picture to points ie the figures indicating 1 am, 3 am 5 am, etc, with the arrows placed approximately radially regarding the clock. The end of the arrows that would be outside of the picture would need to be associated to a caption...such as "recommended position B of the indicator..". I thought this would be relatively easy to do with tikz, and nodes, but could not figure a way to locate the nodes inside the picture. The tip of the arrows should be located accurately inside the picture, therefore placing them in a mechanical way driven by a diameter and an angle would not work well. Any suggestions?


title: How to superimpose LaTeX on a picture?

text: I know how to add a picture to my LaTeX file, e.g. `\includegraphics[width=7cm]{curve.pdf}`. What I'd now like to do is place some latex symbols onto the picture. Like a `\gamma` to name a curve. I do not want to do that in the graphics editing program e.g. because I might want to rename that curve later and don't want to repeat the editing process. I know I can do a `\put` in a `picture` environment. But this environment forces me to specify its size at the beginning. That would be cumbersome since I'd have to go open the graphics file and do some calculations. Is there a way to get the dimensions (or aspect ratio) of a graphics file within LaTeX, so I might use it there? But even if I could do these calculations automatically, I still wouldn't like the redundancy of specifying the width for `\includegraphics` again, but I could live with that. Also, is it possible to specify the size in `cm` to the `picture` environment? I just tried and got some errors. So basically what I am looking for is a solution as simple as possible which: a) lets me specify a width or a height and a file, and displays the image scaled while keeping its aspect ratio and then b) lets me put LaTeX stuff inside the image in relative coordinates (percentages or 0...1), so I won't have to redo anything should I decide that the image needs to be a bit larger or smaller. (b is kind of like setting `\unitlength` to the whole width=height for the 'picture' environment. But of course most images are not square and I also don't appreciate the redundancy (but could live with it).)


title: How do I label parts of an image?

text: > **Possible Duplicate:**   >  How to superimpose LaTeX on a picture? Take this image for example: ![enter image description here](http://i.stack.imgur.com/xIM7y.gif) How can I add labels to an image as done above without manually drawing a line and adding text at the end of the line?


title: Use tikz macros in pgfplots?

text: Since the `axis` environment is within a `tikzpicture` I thought that you could use the usual `\draw` commands within the `axis` environment. I am confused as to why the code below produces the red line outside of the axis? ![enter image description here](http://i.stack.imgur.com/xRZNj.png) Furthermore if you comment out just the `\addplot` call, **both** the red and blue lines are not drawn. ## Questions:   1. Why is the red line drawn outside of the axis environment?    2. Is there a way to use a `\draw` command within the `axis` environment to draw lines bwteen `axis cs` coordinates?   3. Why does commenting out the `\addplot` result in no lines being drawn? ## Code:               \documentclass{article}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[clip=false,ultra thick]         \draw [red] (axis cs: 0.2,0.2) -- (axis cs: 0.6,0.8);         \addplot [mark=*,blue] coordinates{( 0.2,1.2) (0.6,1.8)};     \end{axis}     \end{tikzpicture}     \end{document}


title: Warning message "no argument after \section" in Texlipse

text: I have been trying to get a particular format for section headings in `Texlipse` using the following code.               \usepackage{titlesec}     \titleformat{\section}[block]{\bfseries\filcenter}     {\S\thesection}{1em}{}     \renewcommand\thesection{\arabic{section}}      But I don't get the output in the required format. Moreover, I get a warning message               No argument following \section       Any clues?.


title: Syntax doldrums

text: I am a long time user and fan of LaTeX, but I _hate_ the syntax! I wish it could be more like Python or Haskell. The syntax of those programming languages is much more readable than LaTeX which is ironic because you are much more likely to spend time _reading_ raw LaTeX than programming code. I would like it to be something like               We have     \equation         A =         \bmatrix             a & b             c & d     where ...      Instead of               We have     \begin{equation}         A =         \begin{bmatrix}             a & b \\             c & d         \end{bmatrix}     \end{equation}     where ...      This is a simple example but you all know how onerous the curly brackets \begin's and \end's can get in complicated examples Is there an alternative interpreter for LaTeX that has _nicer_ syntax?


title: Typesetting any language, Vietnamese for example

text: I have this document which contains Vietnamese characters, and it doesn't compile correctly:               \documentclass[letterpaper]{article}     \usepackage[vietnam]{babel}     \begin{document}             Ðàn con chung một trái tim     \end{document}      The characters come out as gobbledygook. I don't know how to give Latex the ability to display characters in any language. It's rather frustrating because I'm used to just typing anything I want in UTF-8. What are the steps to enabling a language in a Latex document? For the answer, you can use my Vietnamese example.


title: Is there a CSS file to make my Webpage "look like" latex ouput

text: In a similar vein to this question, can I make my web page look like is was typeset in latex. I know it won't be possible to replicate the latex look exactly. Is there a CSS file which will control typefaces/font-sizes/margins etc to give the unmistakable latex "look"? (as far as practicable) The layout would probably have to be single column, as a HTML page can scroll indefinitely. So things like page breaks/page-numbers might be irrelevant in this context. I know I could simply replace my HTML file with links to latex set PDFs, but that is not want I want to do. I'm already using mathJax for my equations. I guess what I am really looking for are appropriate CSS settings for the common tags `<body>,<h1>,<h2>,<p>,<strong>` etc, etc.


title: tikzexternalize only (or not) for flagged graphics

text: I have a couple of pictures in my work so I started to build them extern in order to increase build speed. But I don't want to externalize all of them, I want a few little pictures to be build on-the-fly. I found an interesting changelog on sourceforge (maybe the source code for a manual) where it says how to disable the externalization partially with `|\tikzset{external/|\declareandlabel{export}|=false}|` or completely with `|\tikzexternaldisable|,` but that didn' work for me. I activate externalization with               \tikzexternalize[prefix=figures/,figure list=true]       so what kind of command could either externalize only flagged graphics or prevent flagged graphics from being externalized?


title: Create package with C/C++

text: How can I build a new LaTeX package written in C or C++? I'd like to add some new commands to LaTeX, but LaTeX is not for advanced programming, so I should write my commands in another language.


title: Laying out an enumerate environment evenly in two columns with a picture in between

text: I have a list of items inside `enumerate`. I'd like to lay them out in two columns, separated by an image. The numbering matters, so I can't break them into two separate enumerate environment. Is there a way to persuade `multicols` to do this for me ? An alternate strategy is to manually break, and somehow start the second enumerate at the right count. This is inelegant, but would suffice. Is there a way to do that ?


title: Using exam class, text entered in \fullwidth{} messes up pagebreaks

text: I am using the `exam` class to write up a document with questions, but with long passages of text between the questions. In order to get the indentation correct, I have been using `\fullwidth{}` for those long passages of text. However this messes up pagebreaks. After a question ends and a `\fullwidth{}` begins, it seems that LaTeX tries to keep the entire `\fullwidth{}` text on one page. So you get a pagebreak immediately after the question, even if that leaves most of a page of whitespace, and the fullwidth text begins on the next page. My best guess is that `\fullwidth{}` was only designed for one or two sentences of text at most, so I'm looking for some way around this. Minimally working example below:               \documentclass{exam}                      \title{A minimally working example}      \author{Confused Classicist}          \begin{document}     \maketitle     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor    incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\begin{questions}     %%%%     \question  Translate the above passage.     %%%%%     \fullwidth{  All of this text is within one fullwidth command, up until the next question.  You only see the effect when you put in enough text to fill up the first page.          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.               Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          Here ends the fullwidth command.     }     \question Do you value ancient languages?          \fullwidth{This fullwidth command does not have enough text here to fill up this page, so there's no problem. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}          \end{questions}     \end{document}


title: New paragraph style

text: I want to create a few new paragraph styles for a user manual I am writing. The trick part is I want to add an Icon to the beging of the line. I want to create three styles;   * Danger    * Warning   * Important each is differnt in terms of color and have different icons. I want it to be more like a textbox with a boarder around it. keeping in mind that each instance will be no more than 2 lines at very most. e.g. > ![enter image description here](http://i.stack.imgur.com/3YY3w.png) > **Warning;** Risk of Electric Shock


title: What does \ifx\\#1\\ stand for?

text: The following usage of `\ifx` can be found in several packages and also in answers on this site. What does this syntax exactly mean? Are there any alternatives and drawbacks?               \newcommand{\mycommand}[2][]{%       \ifx\\#1\\         <true>       \else         <false>       \fi       % ...     }      (I actually know the answer, but thought this question should exists here. It pops up from time to time. In the unlikely case that it isn't fully answered I will post an own answer in a few days.)


title: Set indentation of choice in exam documentclass

text: I want to create an multiple choices question with this indenting format               1. ########        A. ###        B. ###        C. ###     2. ########        ########        A. ###        B. ###        C. ###      The choices have same indentation as the question text. But, using the default `exam` documentclass, I get this format               1. ########          A. ###          B. ###          C. ###     2. ########        ########          A. ###          B. ###          C. ###      Hence, I try to set the `\leftmargin` to `0pt` inside the `choices` environment to get what I want.               \documentclass{exam}     \begin{document}     \begin{questions}       \question       How old are you?       \begin{choices}         \setlength{\leftmargin}{0pt}         \choice 14         \choice 17         \choice 19         \choice 20         \choice 23       \end{choices}     \end{questions}     \end{document}      But, It get nowhere. So, What is the right way to set indentation of `choice` in `exam` documentclass?


title: Can't make a fraction

text: I had been tried for a long time, but it had worked, I have this code, hope you can help me:               \documentclass{article}     \usepackage{amsmath}          \begin{document}          \begin{pmatrix}      m\\     n     \end{pmatrix} = {\frac{m!}{n!(m-n)!}}          \end{document}


title: TeX Live Windows: Installation Failure

text: I've decided to replace my current MiKTeX installation with TeX Live 2012, and (like previous times) it isn't going too well. Instead of giving up however, I figured I'd ask here this time :) I downloaded the TeX Live 2012 image file (ISO) and mounted it on my machine. Double-clicking the batch file simply doesn't work (my guess is it needs admin privileges), but running it from the command line (Windows+R `cmd` `RET` will start it with admin privileges) at least gets the process started. (Tkinter pops up, bunch of options, etc.). I set my options such that it will install for all users. All other options are left as default. The installation proceeds as one would expect until the following package is installed, throwing the following error: > >     Installing [0244/2479, time/total: 01:08/09:42]: boxhandler [343k] >     Partial download of E:/archive/boxhandler.source.tar.xz found, removing > it. >     untar: untarring C:\texlive\2012\temp\boxhandler.source.tar failed (in > C:\texlive\2012\texmf-dist) >     untarring C:\texlive\2012\temp\boxhandler.source.tar failed, stopping > install. >     Installation failed. >     Rerunning the installer will try to restart the installation. >     Or you can restart by running the installer with: >       install-tl.bat --profile installation.profile [EXTRA-ARGS] >   It consistently fails upon this, and `perl.exe` crashed shortly thereafter, apparently inhibiting the write of `installation.profile`. The exact same thing happens with a text-based interface. * * * Thought: TeX Live comes with `tar`, right?


title: putting the title in the header for an article

text: For various reasons, I need to put my name and title in the header of a LaTeX document. The reason is I have a page limit and need the extra space which is taken up by \maketitle. Does anyone know how to do this? For reference, I am using the standard amsart document class. What I have tried so far is to use the package fancyhdr and then writing               \pagestyle{fancy}     \headheight=14pt          \fancyhf{}          \lhead{name}     \rhead{title}      in the preamble, but I cannot get the header to appear on the first page (the desired header appears on subsequent pages). Does anyone have any suggestions?


title: color package and float package collision

text: I'm writing a document and I wanted to colour some text parts. In the preamble I call `float` package and many others and it worked properly. until I called `color` package. Then LaTeX return errors at some place in the source code:               Missing \endgroup inserted     Missing } inserted     Unbalanced output routine ...      By (un)commenting parts of code I've found that `\newfloat{graf}{tbp}{lop}[chapter]` command causes it. Does anyone have idea why it is working only without `color` package and/or how to define custom floats and be able to use colours? Thanks for your time and suggestions. Edit: Code:               \documentclass[a4paper%,draft%         ,12pt]{report}     \usepackage[cp1250]{inputenc}     \usepackage[english,czech]{babel}     \usepackage{float}     \usepackage[usenames,dvipsnames]{color}          \newcommand{\dd}{\ensuremath{\mathrm{d}}}          %== Graf environment definition==          \newfloat{graf}{tbp}{lop}[chapter]     \floatname{graf}{Graf}     \newcommand{\listofgraphs}{\listof{graf}{List of Graf}}          \begin{document}          Lorem ipsum dolor sit amet.          \end{document}


title: Vertically asymmetric matrices

text: I am noticing an odd problem with LaTeX that causes matrices and arrays that I compile to have a whitespace gap at the top of the array. When I use the same code as others online, I produce different results. I suspect this may be an adverse consequence of packages I have installed, but I am not sure where to begin. I would post a picture, but I was rejected by this website from posting an image....               \begin{equation}     \setlength{\extrarowheight}{0.3cm}     \label{objective}     \left[     \begin {array}{ccc}     9&13&17\\     \noalign{\medskip}     14&18&22     \end {array}     \right]     \end{equation}      The post on vertical asymmetric size variation for parentheses does not solve this issue, though it does allow me to create whitespace at the bottom also. However, this does not eliminate the undesired whitespace gap at the top. * * * I solved my problem. Maybe it serves as an additional answer to the related questions on this site. Using the `\arraystretch` command is an easy way to tune the vertical whitespace in arrays. The following code is an example.               \begin{equation}     \setlength{\extrarowheight}{0.3cm}     \label{objective}     \left[     \renewcommand{\arraystretch}{.4}     \begin {array}{ccc}     9&13&17\\     \noalign{\medskip}     14&18&22     \end {array}     \right]     \end{equation}


title: How can I force a \hspace at the beginning of a line?

text: My code is this:               \setlength{\parindent}{0ex}     \texttt{     x\hspace{1ex}\hspace{1ex}\hspace{1ex}y     \newline     \hspace{1ex}\hspace{1ex}\hspace{1ex}\hspace{1ex}y     }      What I'd like to see is:               x   y         y      What I actually see is:               x   y     y      I've tried various other ways of inserting a space. So far, they've all resulted in leading whitespace being ignored. I've also tried using **\verbatim** and **\alltt** but they eat too many of the other commands that I need preserved (not shown in the example above). _I suppose I could (in the script that emits the LaTeX) count the leading spaces in each line and use different **\parindent** values. I'm looking for something more elegant first._


title: Modify tex file to move chapter headers upper

text: I'd like to modify this code to make chapter titles appear uppper, so more text can get into the first chapter page and modifiy the TOC adding dots from the title to the page number. How can I do it?               \documentclass[11pt,twoside,openright,a6paper]{book}          \usepackage[a6paper]{geometry}          \usepackage{times}     \usepackage[Lenny]{fncychap}          \usepackage[titles]{tocloft}          \title{Microcuentos 1}     \author{Juanjo Conti}     \date{}     \begin{document}          \pagestyle{plain}          \maketitle          \tableofcontents          \chapter*{Justificación de los cuentos cortos}     \addcontentsline{toc}{chapter}{Justificación de los cuentos cortos}          Muchos de los cuentos que escribo son cortos. Esta cuestión anatómica de la literatura tiene una gran ventaja: si el cuento es bueno, en pocas líneas puede sacarte una sonrisa o provocarte un pensamiento profundo. Si el cuento es malo, no importa, en pocos segundos más termina.          Esta teoría, al igual que los cuentos cortos, goza de esta ventaja.               \part*{Sueños}     \addcontentsline{toc}{part}{Sueños}          \chapter*{Los eternos}     \addcontentsline{toc}{chapter}{Los eternos}          La primera vez que nos tocamos fue hace más de quinientos años en una playa en San Salvador, aunque ella llamaba al lugar Guanahaní. Se ocultó detrás de unas rocas sobre la arena cuando vio que una multitud de seres extraños salíamos del agua gritan y empujándonos. Los temores del viaje, las enfermedades, el hambre y el recuerdo de los que habíamos dejado en el mar fueron un catalizador que entró en acción cuando uno de los nosotros gritó “Tierra”.          \end{document}


title: author not appearing in \maketitle in amsart

text: I am new to the `amsart` document class. For some reasons \author (etc..) is not showing after I use `\maketitle`. This is my tex:               \documentclass[12pt,reqno,a4paper]{amsart}          \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{mathrsfs}      \usepackage{amsthm}      \usepackage{latexsym}      \usepackage{pictexwd}     \usepackage{pdftricks}     \usepackage{natbib}     \usepackage{setspace}     \usepackage{color}     \usepackage[affil-it]{authblk}          \begin{document}          \title{Temptation, Asymmetric information and Committment}          \author{Mark}          \affil{University of Leicester}          \date{February 2014}          \maketitle          \begin{abstract}     To be written     \end{abstract}          \section{introduction}          ...          \end{document}      and this is the output: ![enter image description here](http://i.stack.imgur.com/FTnGR.png) can anybody help me out?


title: Is it possible to compile minted under Emacs?

text: I am trying to use minted package... Here is an example `minimal.tex`:               \documentclass{article}     \usepackage{minted}     \begin{document}     \begin{minted}{c}     int main() {     printf("hello, world");     return 0;     4     }     \end{minted}     \end{document}      I need to run `pdflatex -shell-escape minimal` in a terminal to compile it... When I try to compile it within Emacs as a usual tex file by `C-c C-c`, I got an error: `Package minted Error: You must invoke LaTeX with the -shell-escape flag`. Could anyone tell me where I could add this `-shell-escape flag` under Emacs? Another small question is regarding `minted.sty`, at the moment I put it in the same folder as the tex files, which is not the best way I guess... Where do you often put `.sty` files?


title: Double Subscript for Subsequences

text: What's the best way to write subsequences? `$x_n_i$` gives an error, while `$x_{n_{i}}$` works, but it just looks like `$x_{ni}$` (the `i` isn't lowered enough below the `n`)...