title: How to use lipsum with greek as main language

text: I'm trying to create a random text using lipsum having greek as the main language. The problem is that when I try to compile my file, an error keeps occuring about `endcsname`. My code is               \documentclass[a4paper,11pt]{article}          \usepackage[english,greek]{babel}     \usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}     \usepackage{lipsum}              \newcommand{\eng}[1]{\latintext#1\greektext}          \begin{document}        \lipsum[2]     \end{document}      I also tried to run it using `\eng{\lipsum[2]}` instead of `\lipsum[2]` but it didn't seem to work. The only way to make it work is to have english as the main language. Is there a way to solve that?


title: Multicolumn cells in tabularx overfill into margin

text: I have this table in my `MWE`. In the 2nd table, the cell colors seem to bleed over into the margin. I have tried to set various parameters with the `tabularx` and in the `multicol` to reduce this but it isn't exact. Is there a reason both `linewidth` and `textwidth` offer different widths on the same page. In other words, both tables are identical, except with the multicol which I image is the issue.               \documentclass[letterpaper]{memoir}     \usepackage{color, colortbl, longtable}     \usepackage{booktabs}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \usepackage{multicol}     \usepackage{tabularx}     \usepackage{lipsum}          \begin{document}          \lipsum[1]          \begin{center}     {\rowcolors{2}{black!10}{white}     \begin{tabularx}{\linewidth}{lX<{\raggedright}X<{\raggedright}}     \toprule     \textbf{Property}   &       \textbf{Addition}       &       \textbf{Multiplication} \\     \midrule     Associative     &   $\mathbf{A + (B + C) = (A + B) + C}$                         $2 + (3 + 4) = (2 + 3) + 4$                                                              &       $\mathbf{A \times (B \times C) =                                                                  (A \times B) \times C}$                                                                          $2 \times (3 \times 4) = (2 \times                                                                  3) \times 4$ \\                     &   Basically, if you only see addition                          signs around, it's okay, group the                          numbers however you want        &       Same deal here. If there's nothing                                                                  but multiplication, it doesn't matter                                                                  where the parentheses are. \\     \midrule     Commutative     &   $\mathbf{A + B = B + A}$ \newline                         $5 + 7 = 7 + 5$                 &       $\mathbf{A \times B = B \times A}$ \newline                                                                 $5 \times 7 = 7 \times 5$ \\                     &   No big deal. Addition works in                          any order.                      &       Same! Multiplication doesn't care about                                                                  order. \\     \midrule     Identity            &   $\mathbf{A + 0 = A}$ \newline                         $3 + 0 = 3$                     &       $\mathbf{A \times 1 = A}$ \newline                                                                 $3 \times 1 = 3$ \\                     &   It's good to remember this one.                         Anything plus zero is just                          itself.                         &       For multiplication, anything times one                                                                  is itself. \\     \bottomrule     \end{tabularx} }          \bigskip     {\rowcolors{2}{black!10}{white}     \begin{tabularx}{\textwidth}{XX}     \toprule             \multicolumn{2}{c}{\textbf{Distributive:}} \\            \midrule             $\mathbf{A(B + C) = A              \times B + A \times C}$         &                                                    $7(3 + 1) = 7 \times 3 + 7 \times 1$    \\             \multicolumn{2}{p{\textwidth}}{             This will help you a lot. If there's             more than one number inside              parentheses, then you can do              the operation (in this case,              multiplying by $7$) to each              number in the parentheses             to simplify things.} \\     \bottomrule     \end{tabularx}}     \end{center}          \end{document}


title: Seqsplit problems with UTF8

text: I'm using `seqsplit` to split long words within cells of a `longtable`. I'm using `utf8x` and `ucs` packages too. I'm generating PDFs out of those `.tex` files. When words have UTF-8 characters, the first one in the sequence raises an error.               \seqsplit{Música} using utf8x appears as `M[U+FFFD]sica`      This is the error it raises:               ! Package utf8x Error: MalformedUTF-8sequence.          See the utf8x package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.398 .. com} & \seqsplit{Música}          Ifthecharacterisanargument,putitin{}               Package ucs Warning: Unknown character 65533 = 0xFFFD appeared again. on input      line 398.      If I remove `seqsplit`, the word appears correctly, but I need to use this package, maybe someone knows an alternative or macro I can use. The funniest part is that if the word contains two or more UTF-8 characters, what I get is:               \seqsplit{Múúsica} `M[U+FFFD]úsica`      Only fails in the first character, so I'm sure UTF-8 encoding is correctly done.


title: Remove page number from index entries

text: My indexed terms are hyperlinks (to external files -- see question listed below), so the page numbers are really not useful information. Hece I would like to be able to remove the page number (and the comma preceding the page number). The MWEs below produce the image on the left, but I would like it to produce the image on the right: ![enter image description here](http://i.stack.imgur.com/PyJ7i.png) ![enter image description here](http://i.stack.imgur.com/ez2sM.png) Would be nice if one solution worked with all the packages, but package specific solutions are ok too. I am using `imakeidx` so that would be most helpful to me. ## References:   * This is a follow up to Index hyperlinks to open a PDF file.   * List of Indexing Packages - Pros and Cons ## Code: `imakeidx`               \documentclass{article}     \usepackage{imakeidx}     \usepackage{hyperref}          \makeindex[columns=1]          \begin{document}       Test\index{foo}       \index{bar}       \printindex     \end{document}      ## Code: `makeidx`               \documentclass{article}     \usepackage{makeidx}     \usepackage{hyperref}     \makeindex          \begin{document}       Test\index{foo}       \index{bar}       \printindex     \end{document}


title: How can I prevent a new paragraph between two \input commands?

text: I want to use the command `\input{}` to insert two textfiles, `text1.tex` and `text2.tex`, into my latex working file. I want these two textfiles to produce one single paragraph when I am compiling my working file. However, when I place               \input{text1.tex}\input{text2.tex}       in a single line in the working file, the content of the two text files still ends up in two different paragraphs in the compiled text. I have tried to put the command `\nolinebreak` between the two `\input{}` commands without success. So, how can I prevent a new paragraph to be produced between the two textfiles?


title: About some shortcuts used in LyX

text: Please tell me how to use shortcuts in LyX to implement the codes below               $\sum\limits_{\substack{0<k<p\\\gcd\left(  k,p\right)  =1}}$      Notice that do not use the function of inserting TeX code in LyX! By the way, it is very easily implemented in Scientific Workplace. Just like that   1. `Ctrl`+sum   2. `Ctrl`+`F5`   3. `TAB`   4. `↓`   5. `ENTER`   6. `Ctrl`+`l`   7. `0<k<p`   8. `ENTER`   9. gcd(k,p)=1 That's all! The primary difficulty in LyX is that the Step 8 can not be easily implemented, so I ask the question here. Wait for your elegant solution...


title: \addbibresource undefined control sequence with MikTex

text: I'm using the latest version of MikTex, which comes with biblatex, and I can't get biblatex to work. It breaks in the preamble:               \documentclass[a4paper,12pt]{scrartcl}     \usepackage{hyperref}     \usepackage[style=authoryear]{biblatex}     \addbibresource{soarBib.bib}     \title{A title}     \subtitle{Some Subtitle}     \author{Nate Glenn}     \date{May 16, 2011}     \begin{document}      The errors are:               ! Undefined control sequence.     <recently read> \addbibresource     l.5 \addbibresource     {soarBib.bib}     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.     ! LaTeX Error: Missing \begin{document}.     ...          ! Package biblatex Error: File 'literatureReview.bbl' not created by biblatex.     See the biblatex package documentation for explanation.


title: Making a table of content for LaTeX

text: I have to write a paper for UNI, as a requirement I have to respect the template and the rules set by the supervisors for writing the paper in LaTeX. There is a requirement stating: After the abstract add your local table of contents with the commands `\bigskip\par\hrule\smallskip\par\setcounter{minitocdepth}{2} \dominitoc`. Since my experience with LaTeX is very slim, I fail to understand what is happening there, and how a table of content can be created with those lines. Would you please explain what's happening there in a simple fashion, understandable for someone inexperienced. additional info from the rules: Your header must look as follows:               \documentclass{svmult}     \usepackage[utf8x]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{makeidx}     \usepackage{graphicx}     \usepackage{multicol}     \usepackage[bottom]{footmisc}     \usepackage{amsmath, amssymb, amsfonts, amscd}     \usepackage{algpseudocode}     \usepackage{algorithm}     \usepackage{listings}     \usepackage{verbatim}     \makeindex      SOLUTION: OK seemed to work like this: Didn't do much, just had to refresh the FNDB (filename database) and then it worked... Well I use MikTeX on windows, I think the equivalent of refresh FNDB in Linux is `$ texhash` To explain the workflow.   1. Just pasted the line `\bigskip\par\hrule\smallskip\par\setcounter{minitocdepth}{2} \dominitoc`   2. then added `\usepackage{minitoc}` to the header, so it gets installed to the Miktex, then had to remove it because it gave some error.    3. after removing that line and refreshing FNDB everything worked fine. There is no need to write `\tableofcontents` or something, the table of content is generated automatically Thanks for the patience! Peace!


title: Why it is not centered?

text: Could anyone tell me why the following scripts have non-zero margin in the left side of the figure????               \documentclass[class=minimal,border=0pt]{standalone}          \usepackage{tikz}     \usetikzlibrary{shapes,arrows}          \begin{document}          % Define block styles     \tikzstyle{block} = [rectangle, draw, line width=0.5mm, black,          text width=5em, text centered, rounded corners, minimum height=2em]     \tikzstyle{line} = [draw, -latex]          \begin{tikzpicture}[node distance = 1cm, auto]         % Place nodes         \node [block] (BLOCK1) {a};         \node [block, below of=BLOCK1] (BLOCK2) {b};         \node [block, below of=BLOCK2, node distance=1cm] (BLOCK3) {c};         % Draw edges         \path [line] (BLOCK1) -- (BLOCK2);         \path [line] (BLOCK2) -- (BLOCK3);     \end{tikzpicture}          \end{document}


title: Why does Latex/Bibtex need three passes to clear up all warnings?

text: As explained by Andy Roberts, if you need to compile a new document with bibtex citations, then you need to run latex three times, and bibtex once:               latex document     bibtex document     latex document     latex document      Why can't latex figure this out itself, and just do what it needs to do? What is it doing in the later runs that it can't do in the earlier runs?


title: Plots with only a few (shifted) error bars

text: I want to make a figure with several plots with error bars. Each curve has 1100 points. I want to draw only a few (5) error bars to increase legibility. For the same reason, I would like to have each set of error bars shifted of a different interval. Something like : plot 1 : error bars at 0, 250, 500, 750, 1000 ; plot 2 : error bars at 10, 260, 510, 760, 1010 ; plot 3 : error bars at 20, 270, 520 ,770, 1020 ; etc. My current attempt is :               \pgfplotsset{err/.style={each nth point={250},forget plot,draw=none}}     \pgfplotsset{errp/.style={err, error bars/.cd,y dir=plus,  y explicit}}     \pgfplotsset{errm/.style={err, error bars/.cd,y dir=minus, y explicit}}          % plot 1     \addplot+[errm] table[x index=0,y index=1, y error index=2}]{\table};     \addplot+[errp] table[x index=0,y index=1, y error index=3}]{\table};     \addplot table[x index=0,y index=1]{\table};          % plot 2     \addplot+[skip coords between index={0}{10}, errm] table[x index=0,y index=4, y error index=5}]{\table};     \addplot+[skip coords between index={0}{10}, errp] table[x index=0,y index=4, y error index=6}]{\table};     \addplot table[x index=0,y index=4]{\table};          % plot 3     \addplot+[skip coords between index={0}{20}, errm] table[x index=0,y index=7, y error index=8}]{\table};     \addplot+[skip coords between index={0}{20}, errp] table[x index=0,y index7, y error index=9}]{\table};     \addplot table[x index=0,y index=7]{\table};          % etc.      The `each nth point={250}` acts as I want but `skip coords between index={0}{20}` does not (it only suppress the first error bar). In addition, compilation time is tremendous and I wonder if changing somehow my method could diminish it (I already use externalisation). My other attempt was to generate a table for the errors containing only the relevant data and plot them all. This is somewhat more cumbersome because it requires to go back to the generation of data each time one wants to alter how the plot looks. _To sum up:_   * how to introduce the skip ?   * Is there a more concise and efficient code to do that ? _Some data:_ full.dat First column is abscissa. Then 3 column of data. Then 3 column minus error. Then 3 column plus error. _The example:_ expl.tex is the main, graph.tex is the figure. expl.tex graph.tex


title: Integrating external dictionaries with Texmaker

text: I'm a relatively new LaTeX user and I want to know:   1. Is there a way to link an external dictionary to LaTeX and   2. what dictionaries are recommended?


title: new command, pfgkeys within pfgplots axis environment

text: I am trying to setup an command to create technical drawing dimensions (inspiration from Dimensioning of a technical drawing in TikZ). I would like to use `pgfkeys` for that, in order to pass multiple optional arguments in the same spirit of `TikZ`. I works pretty fine (at least I can get what I need) except within an `axis` environment (from `pgfplots`). I seems that all `pgfkeys` from all `dimline` calls are overridden by the last one. I am using last MacTex for MacOSX. I am compiling the source using:               /usr/texbin/xelatex -interaction nonstopmode -shell-escap -output-directory . test3.tex      Any idea why the `axis` environment zaps all `dimline` options? Here is my code:               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{calc}          \pgfkeys{       dimline/.is family,       dimline,       dimcolor/.initial = black,       start line/.initial=1cm,       start line width/.initial=0.01,       end line/.initial=1cm,       end line width/.initial=0.01,       label pos/.initial={},     }          % #1: optional keys parameters     % #2: start point     % #3: end point     % #4: text          \newcommand{\dimline}[4][]{%            \pgfkeys{         dimline,         #1,         start line width/.get=\dimlinestartlinewidth,         start line/.get=\dimlinestartline,         end line/.get=\dimlineendline,         end line width/.get=\dimlineendlinewidth,         label pos/.get=\labelpos,       }            \begin{scope}[         dimrecall/.style={\pgfkeysvalueof{/dimline/dimcolor}},         dimline/.style={\pgfkeysvalueof{/dimline/dimcolor}},         ]              \node (a) at #2 {};         \node (b) at #3 {};              \draw [/tikz/dimrecall, line width=\dimlinestartlinewidth]         (a.center) -- ($(a)!\dimlinestartline!-90:(b)$);         \draw [dimrecall, line width=\dimlineendlinewidth]         (b.center) -- ($(b)!\dimlineendline!90:(a)$);              \draw[|<->|, dimline,] (a.center) -- (b.center)         node[fill=white, sloped, midway] {\tiny{#4}};       \end{scope}     }               \begin{document}          Correct without \texttt{axis} environment:          \begin{tikzpicture}       \draw  (0,0) -- (0,4) -- (.5,4) -- (.5,5) -- (1.,5) -- (1.,4) -- (1.5,4) -- (1.5,0) -- cycle;       \dimline[dimcolor=blue,start line=-0.25, end line=-0.25]{(3,0)}{(3,4)}{4.0};       \dimline[dimcolor=red,start line=0.85, end line=0.85]{(0,6)}{(1.5,6)}{1.5};     \end{tikzpicture}               Incorrect within \texttt{axis} environment \texttt{pgfkeys} are overriden:          \begin{tikzpicture}       \begin{axis} [         xmin = -1,         xmax = 8,         ymin = -1,         ymax = 8]              \addplot[mark=none,  color=black] coordinates {           (0,0)  (0,4) (.5,4) (.5,5) (1.,5) (1.,4) (1.5,4) (1.5,0) (0,0)         };              \dimline[dimcolor=blue,start line=-0.25, end line=-0.25]{(axis cs: 3,0)}{(axis cs:3,4)}{4.0};         \dimline[dimcolor=red,start line=0.85, end line=0.85]{(axis cs: 0,6)}{(axis cs: 1.5,6)}{1.5};            \end{axis}          \end{tikzpicture}          \end{document}      and the result ![image](http://i.stack.imgur.com/jLNqh.png)


title: Text and figure side by side in a list in ConTeXt

text: I want to include some figures on the right of some list items. Here is an example with one figure in the second item:               \starttext     \startitemize[n]         \item first item         \item \placefigure[right]{none}{\framed[width=1in]{Figure}} \input knuth         \item third item     \stopitemize     \stoptext      Everything is great except there is a blank line after the item label. How can I remove this blank line so the content of the item is right after the item label? If I use `\startfiguretext` instead of `\placefigure`:                   \item \startfiguretext[right]{none}{\framed[width=1in]{}} \input knuth         \stopfiguretext      Not only is there a blank line after the item label, but the list item is no longer indented.


title: LuaLaTeX - Problem with defining Cambria Math only for special font types

text: I've got a problem, that I can't fix. As soon as I try to use Cambria Math as font for `\mathscr` and `\mathbfscr` I get a > "missing \endcsname inserted" as error. I'm new to LuaLaTeX so I simply copied this line from a pdf document that I've found. Everything works fine when I use Cambria Math directly with `\setmathfont` instead of xits. So the font itself seems to be installed correctly.               \documentclass{scrbook}     \usepackage{fontspec}     \usepackage{unicode-math}     \setmathfont{Cambria Math}     \setmathfont[range={\mathscr,\mathbfscr}]{Cambria Math}          \begin{document}         Hello world!     \end{document}      Maybe someone can help me with that.


title: How to make latex recognize tick and cross symbols

text: I'm looking for a way of making latex recognize the tick and cross symbols as apposed to having to use commands in latex code to make these symbols. Is there anything you can add in the preamble that supports the use of such characters? The reason for this is that I'm generating a pdf and html document from the same source, so using commands unique to latex will mess up the formatting of my html doc. Even still, I don't seem to be able to use the `\checkmark` command (after including the `\usepackage{amsfonts}`). I believe this because I'm using Sphinx - a tool that uses a mark up language of its own - to convert a document into latex format then pdf. I think it misses the \commandgoeshere bits when going from the markup to latex. Thanks Edit: Having spent some tome on it, it appears that the solution proposed below works perfectly. The problem is in fact to do with sphinx. When making these changes in the .tex file, the pdf that is generated produces the desired results. But when making the change to the preamble through the configuration file and then run `make latexpdf` an error gets thrown up relating to something (though it looks like nothing) in the latex.py file right in the guts of sphinx. But I guess this is to be discussed in a different post


title: How to remove the headers in the table of contents in memoir class?

text: In the project I was making with the `memoir` class, I made a page style named **CCSL** derived from `plain` pagestyle.               \documentclass[extrafontsizes,11pt,twocolumn,openany,openbib]{memoir}     \copypagestyle{CCSL}{plain}     \makeevenhead{plain}{\thepage}{}{\bfseries\leftmark}     \makeoddhead{plain}{\bfseries DOCUMENT TITLE}{}{\thepage}     \makeevenfoot{plain}{}{}{}     \makeoddfoot{plain}{}{}{}          \begin{document}     \onecolumn     \pagestyle{empty}{\color{white}a}     \par\vspace{0.35\textheight}     {\centering\noindent{\scshape\HUGE\textbf{DOCUMENT TITLE}}\linebreak     \large{SOME TEXT}\\     \large{SOME TEXT}     \par\vspace{3\baselineskip}     \noindent\LARGE\bfseries {SOME TEXT}\\}     \clearpage     \tableofcontents     \twocolumn          \pagestyle{CCSL}     \chapter*[SOME CHAPTER]{SOME CHAPTER}     .     .     .     \end{document}      As you can see from my code, I used the `empty` pagestyle for the self-made title page and the table of contents page, and then I applied the `CCSL` pagestyle to the rest of the document. However, the setting of `empty` pagestyle only worked to the self-made title page and not with the ToC page, and weirdly, it adapted the pagestyle that was set after `\tableofcontents`. I tried using `\thispagestyle{empty}` for the ToC page but it did nothing. I also tried putting `\pagestyle{empty}` immediately before the `\tableofcontents`, but it had the same effect.


title: How to vertically center a minipage within a tabular environment

text: My goal is to have the minipage of the second column vertically centered but I could not manage do do it. I tried the array package with the 'm' option : `\tabular{c|m}` but it did not worked, I also tried to set the `[t]` option both to the `minipage` and to the `tabular` but with no success. Do you know a way to make it works? Here is a minimal exemple:               \documentclass[10pt,mathserif,smaller,fleqn]{beamer}     \usepackage{tikz}     \usepackage{multicol}     \usepackage[utf8]{inputenc}     \usetheme{Antibes}     \setbeamertemplate{navigation symbols}{}          \begin{document}         \frame{             \begin{center}                 \begin{tabular}[t]{c|c}                     \multicolumn{2}{c}{Une architecture hybride}\\[0.4em]                 \hline~\\[0.4em]                     \begin{tikzpicture}[scale=.5]                         \input{hybride.tikz}                     \end{tikzpicture}                 &                     \begin{minipage}[t]{0.4\textwidth}                         \begin{itemize}                             \item bla                             \item bla                             \item bla                         \end{itemize}                     \end{minipage}                 \end{tabular}            \end{center}         }     \end{document}      And here is the file hybride.tikz               \tikzset{client/.style={draw,rectangle,rounded corners=3pt,color=blue},          server/.style={draw,rectangle,color=red}};          \node[client] (A) at (0,0) {Pair};     \node[client] (B) at (8,0) {Pair};     \node[client] (C) at (4,6.92) {Pair};     \node[server] (D) at (4,2.31) {Oracle};          \draw[->, >=latex, color=blue] (A) to[bend left=10] (B);     \draw[->, >=latex, color=blue] (A) to[bend left=10] (C);     \draw[->, >=latex, color=blue] (B) to[bend left=10] (A);     \draw[->, >=latex, color=blue] (B) to[bend left=10] (C);     \draw[->, >=latex, color=blue] (C) to[bend left=10] (A);     \draw[->, >=latex, color=blue] (C) to[bend left=10] (B);     \draw[->, >=latex, thick, color=red, dashed] (D) -- (A);     \draw[->, >=latex, thick, color=red, dashed] (D) -- (B);     \draw[->, >=latex, thick, color=red, dashed] (D) -- (C);


title: Changing colon to comma after conference address with biblatex

text: I have a bibliography entry               @conference{dempsey-davis1998,             author={Dave Dempsey and Chris Davis},             title={Error analyses and test of pressure gradient force schemes in nonhydrostatic, mesoscale model},             year={1998},             pages={236--239},             publisher=AMS,             booktitle={12th Conf. on Numerical Weather Prediction},             location={Phoenix, AZ}     }      Which, using `authoryear`, is formatted as > Dempsey, D. and C. Davis (1998). Error analyses and test of pressure > gradient force schemes in nonhydrostatic, mesoscale model. In: _12th Conf. > on Numerical Weather Prediction_. Phoenix, AZ: Amer. Meteor. Soc., pp. > 236–239. How can I change the colon that appears after the location to a comma?


title: macro to showcase newly defined macros

text: I have the following MWE which takes an argument and prints it verbatim. I have obtained the code from this answer.               \documentclass{article}     \makeatletter     \newcommand{\myverb}{%         \begingroup         % deactivate special characters         \let\do\@makeother         \dospecials         % change '{' and '}' back to normal         \catcode`\{=1         \catcode`\}=2         \@myverb%     }     \def\@myverb#1{%         \endgroup%         \texttt{#1}%     }     \makeatother     \begin{document}     \myverb{$\alpha$}     \end{document}      yields `$\alpha$` on the page. I want to define a macro `\showcase` which will print the code that was used for the text, and the evaluation of that code, namely               \newcommand\showcase[1]{\myverb{#1} #1}     \showcase{$\alpha$}      I expected this to print               $\alpha$ <actual-letter-alpha>      but instead it prints               <actual-letter-alpha> <actual-letter-alpha>      because the argument is expanded before it is taken by `\myverb` (I think). What should I do to make the macro behave the way I want? **Note:** I want to use this macro either inside a table or minipages, so that I can showcase the macros I have defined. So I need to be able to play with it, like put the column delimiter `&` between, or separate them into two minipage environments.


title: Recursive block matrix

text: I am currently writing a document in which I need to create a matrix that looks like the picture below. What is the shortest and easiest way to do so? ![enter image description here](http://i.stack.imgur.com/vtRY8.png)


title: How can I keep the size of my subsubsection the same size as the paragraph font size?

text: I would like to keep my subsubsection header the same size of the paragraph font, can someone help me? at the moment the subsubsection font is the equivalent of \small whilst the paragraph font is \normal. This is my preamble:               \documentclass[12pt]{report}     \usepackage{graphicx}     \usepackage{geometry}     \usepackage{fixltx2e}     \usepackage{grffile}     \usepackage[font=small,labelfont=bf]{caption}     \usepackage{floatrow}     \usepackage{amsmath}     \usepackage{longtable}     \usepackage{tocbibind}     \usepackage{fancyhdr}     \usepackage{titlesec}     \usepackage{epstopdf}     \usepackage{booktabs}     \usepackage{multirow}     \usepackage{tabularx}     \usepackage{tabu}     \usepackage{ragged2e}     \newcolumntype{L}{>{\RaggedRight\arraybackslash}X}          \titleformat{\section}       {\normalfont\fontsize{14}{12}\bfseries}{\thesection}{1em}{}     \makeatletter     \renewcommand{\paragraph}{%       \@startsection{paragraph}{4}%       {\z@}{1.2ex \@plus 1ex \@minus .2ex}{-1em}%       {\normalfont\normalsize\bfseries}%     }     \renewcommand{\baselinestretch}{1.0}     \makeatother     \setcounter{secnumdepth}{3}      and then I just use `\subsubsection`


title: When can I safely add an empty line?

text: I really like spacing my LaTeX to stay organized, but I'm always scared that adding a space will affect the output when all I really wanted to do was separate the "code" a bit. So most of the time I insert a "%" in the empty lines just to be safe, or I experiment. For example, I know (by playing with it) that the empty lines in the following are not doing any harm:               \documentclass{article}     \begin{document}          \title{My title}     \author{My author}     \date{\today}     \maketitle          \begin{abstract}     This is my abstract!     \end{abstract}          \section{Introduction}     Bla bla bla.     \end{document}      But I'm wondering, is there a steadfast rule that I can use to know right away if an empty line will affect output?


title: Texmaker not generating pdf everytime, but showing the same old pdf

text: I am new to TeXmaker and all its tools. I have my thesis template in LaTeX which I am trying to work on and am using Adobe Reader to view it. The problem is that Texmaker is generating a pdf file for the first time (which is OK), but does not generate it anytime later. When I delete the old pdf file (for deleting the pdf file, I need to close Texmaker every time), then again it generates the new pdf file. But once a pdf file is already there, it shows the same pdf file.


title: Margin notes (and subsection titles) in both sides of a two column document

text: I would like to write a book document with two columns and subsubsection titles as margin notes at both sides of the page (in the side which corresponds to the column). In order to specify the subsubsection titles I have used a simple variation of titlesec example code:               \newcommand{\secformat}[1]{\MakeLowercase{\so{#1}}}     % \so spaces out letters     \titleformat{\subsubsection}[block]     {\normalfont\scshape\filcenter}     {\thesubsubsection}     {1em}     {\secformat}     % La subsubseccion     \titleformat{\subsubsection}[leftmargin]     {\normalfont     \titlerule*[.6em]{\bfseries.}%     \vspace{6pt}%     \sffamily\bfseries\filleft}     {\thesubsubsection}{.5em}{}     \titlespacing{\subsubsection}     {4pc}{1.5ex plus .1ex minus .2ex}{1pc}      As you can see following image, margin titles are located in the left side as it's set as a fixed parameter in the code, so titles are over the text in the right column. ![two-column example](http://i.stack.imgur.com/yscZG.jpg) I would like to know how I can check dynamically if the title corresponds to the right or the left column and to put it in the real margin: I suppose it could be done by setting the parameter `[leftmargin]` or `[rightmargin]` but I'm not sure :-?


title: How to have a precise control on the size of each page?

text: I would like to produce a `pdf` document whose pages have various lengths and fixed widths. ## An easier situation The easiest case would be for instance: the first page has a length of `10cm` all the next pages have a length of `15cm`. But, what I am looking is more complicated. I wonder if it is possible. ## The real situation Here is what I would like to achieve:   * the first page has a variable length, depending of the content (cf. this question), which is at most `10cm`   * the next pages have a length equal to `15cm`   * the last page has a variable length, depending of the content, which is at most `15cm` ## Bounty-rewarded For those interested, there will be bounties for answers. * * * ## EDIT (11/09/2014): Here is a MWE where the solution of Heiko does not work (see below and compare with the image in Heiko's answer). Anyone any knowledge? The first (white) page has a length of `5cm` which is normally the length that should be omitted where computing the height of the first page.               \documentclass{article}     \usepackage[       paperwidth=15cm,       paperheight=15cm,       hmargin=1cm,       vmargin=0cm,     ]{geometry}          \usepackage[framemethod=tikz, needspace=1.5cm]{mdframed}          \newmdenv[%     innerleftmargin = 2mm,     innerrightmargin = 2mm,     innertopmargin = 2mm,     innerbottommargin = 2mm,     leftmargin = 0mm,     rightmargin = 0mm,     splitbottomskip = 2mm,     splittopskip = 4mm,     middlelinewidth = 0mm,     linecolor = red,     backgroundcolor = red,     roundcorner = 0pt,     skipbelow = 0mm,     skipabove = 0mm,     ]     {mybox}          \pagestyle{empty}          \flushbottom     \setlength{\maxdepth}{0pt}% to address the "third bug"     \setlength{\topskip}{0pt}% no space above the first line          % assuming the page number is the absolute page number     \usepackage{zref-totpages,zref-savepos}     \usepackage{atbegshi}          \makeatletter     \providecommand*{\zsaveposy}{\zsavepos}% for older zref-savepos     \def\@oddhead{\PosFirstHead\PosLastHead\hss}%     \def\@evenhead{\PosLastHead\hss}%     \newcommand*{\PosFirstHead}{%       \ifnum\value{page}=1 %         \zsaveposy{PosFirstHead}%         \global\let\PosFirstHead\@empty       \fi     }     \newcommand*{\PosLastHead}{%       \ifnum\value{page}=\ztotpages         \zsaveposy{PosLastHead}%         \global\let\PosLastHead\@empty       \fi     }     \AtBeginShipout{%       \ifnum\value{page}=1 %         \dimen@=\dimexpr           \zposy{PosFirstHead}sp-\headsep           -\zposy{PosFirst}sp%         \relax         \setbox\AtBeginShipoutBox=\vbox{%           \kern-\dimen@ %           \copy\AtBeginShipoutBox         }%         \advance\pdfpageheight by -\dimen@       \else         \ifnum\value{page}=\ztotpages           \advance\pdfpageheight by%             -\dimexpr               \textheight               -\zposy{PosLastHead}sp+\headsep               +\zposy{PosLast}sp%             \relax         \fi       \fi     }     \AtEndDocument{%       \par       \nobreak       \dimen@=\prevdepth       \ifdim\dimen@>\maxdepth         \kern-\maxdepth       \else         \ifdim\dimen@>0pt %           \kern-\dimen@         \fi       \fi       \zsaveposy{PosLast}%     }     \makeatother          \usepackage{lipsum}% provides dummy text          \begin{document}     \vspace*{\dimexpr5cm-\topskip plus 1fill}% first page should not be larger than 15cm     \zsaveposy{PosFirst}     \nointerlineskip          \begin{mybox}     \lipsum[1-1]     \end{mybox}          \lipsum[1-9]          \end{document}      ![enter image description here](http://i.stack.imgur.com/gnXk6.png)


title: Environment to underline/strikeout for comparing versions

text: I have a TeX file that I'm editing with several collaborators and we use environments to highlight and discuss proposed changes like the following:               Some text.          \begin{old}       Text that I propose to remove.       Which may be more text than fits on a single line            and even include paragraph breaks.     \end{old}          \begin{new}       Text that I propose to insert.     \end{new}      Currently, the old/new envs just set a text color, which is fine on screen but less so on a b/w printer. I'd like to use strikethrough/underline as well (like a well-known word processor), is this possible with TeX? I've experimented with the ulem and soul packages, but they don't seem to work well with environments:               \newenvironment{old}{\ul \bgroup}{\egroup}      and related attempts don't seem to work or produce errors like "missing number". The other method I know of to make commands work in environments               \newsavebox{\oldbox}     \newenvironment{old}{\begin{lrbox}{\oldbox}}{\end{lrbox}\ul{\usebox{\oldbox}}}      doesn't seem to work either. Is there a way to get the effect that I want? My system is Ubuntu "This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)" if that helps.


title: Package incompatibilites: etoolbox, hyperref, and bm, standalone?

text: I am trying to transition to using the `etoolbox` package, but seem to have run into some difficulties and they appear related to the `hyperref` and `bm` packages which to me seem totally unrelated. The MWE example compiles since `\RemoveEToolbox` is defined and shows that there is no apparent problem before `etoolbox` was used. Commenting out the `\def\RemoveEToolbox{}` line produces two problems:   1. With both the `\renewcommand`, and the `usepackage{hyperref}` commented, this results in **"Runaway argument? Paragraph ended before \bm@test@token was complete"**.   2. Including the `usepackage{hyperref}` (with `\renewcommand` commented) results in **"Undefined control sequence. \Call@AtVeryEndDocument ...cumentHook \@undefined"** But if uncomment the `\renewcommand{\bm}{#1}` line (effectively doing without any `\bm`), then this seems to compile. I have been using this for a while now and things appeared to have been working fine, but now that I attempt to use `etoolbox` I seem to run into problems.               \documentclass{standalone}     \def\RemoveEToolbox{}% Shows that this works fine without {etoolbox}          \usepackage{amsmath}     \usepackage{xcolor}     \usepackage{bm}          \ifdefined\RemoveEToolbox         \newcommand*{\iftoggle}[3]{#2}% Default to true value of "if"     \else         \usepackage{etoolbox}         \newtoggle{paper}         \toggletrue{paper}              %\renewcommand{\bm}[1]{#1}% Why can't I have a normal \bm with {etoolbox}?     \fi          % \usepackage{hyperref}          \begin{document}          This document is intended for      \iftoggle{paper}{paper}{electronic}     distribution.          \bm{\textcolor{blue}{Solve $x^2-1=0$}}          \begin{align*}         a &= b\\         \iftoggle{paper}{             c &= d\\         }{}         e &= f\\     \end{align*}     \end{document}


title: Removing extra vertical space in \maketitle with titling package

text: Consider the following two LaTeX source files: First, manually producing a title using a new environment (eww):               \documentclass[a4paper,10pt]{article}     \parindent0cm%     \newenvironment*{mytitle}{\begin{LARGE}\bf}{\end{LARGE}\\[1.5ex]}%     \begin{document}     \begin{mytitle}This is a test document\end{mytitle}     \end{document}      Secondly, redefining `\maketitle` using the `titling` package:               \documentclass[a4paper,10pt]{article}     \parindent0cm%     \usepackage{titling}     \pretitle{\begin{LARGE}\bf}%     \posttitle{\end{LARGE}\\[1.5ex]}%     \preauthor{}%     \postauthor{}%     \predate{}%     \postdate{}%     \title{This is a test document}     \date{}     \begin{document}     \maketitle     \end{document}      Why does the second "proper" solution give substantially more vertical whitespace before the title? What can I do about it? [ Context: I am turning a horrible "let's pretend LaTeX is a word processor" TeX template for a conference into a proper class, and I need to match the spacing. ]


title: Problem with XeTeX (LaTeX) and system fonts

text: I have started to use an enterprise specific class for LaTeX, but have got a problem with usage system fonts in Ubuntu. The class uses the fontspec package, I have therefore been instructed to use XeTeX (i.e. the command xelatex instead of latex or pdflatex). However, the command `xelatex testfile.tex` results in the following message:               ! Package xkeyval Error: `TeX' undefined in families `Ligatures'.          See the xkeyval package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.61 \newfontfamily\headfont{Arial}          ?       The class has previously been used on Mac and Windows and the font setup is as follows:               \newfontfamily\headfont{Arial}     \newcommand\texthead[1]{\headfont #1}     \setromanfont{Georgia}     \setmainfont{Georgia}     \setsansfont[Scale=MatchLowercase]{Verdana}      It has been suggested that since XeTeX makes use of system fonts and the class file has worked flawlessly on Mac and Windows, the problem might be that Arial is not a name used in Ubuntu. I have tried to exchange `Arial` with `Ubuntu Light` in the setup code above, but that have not been any improvement. Any suggestions please on how to move forward? **UPDATE** Due to the comment from Joseph Wright, I started investigate the class file in more detail. I managed to get the command `xelatex quickstart.tex` to result in a PDF-file after having commented the line               \defaultfontfeatures{Ligatures=TeX,Mapping=tex-text}      and having replaced Helvetica with Arial in the following line               \newfontfamily\enterprisetitlefont{Helvetica}      (The parameter enterprisetitlefont is used in a re-definition of the maketitle command.) After having seen the comment by egreg, I removed `Ligatures=TeX` from the `defaultfonfeatures` line and it worked fine. I am using the latest TeX Live distribution available in the Ubuntu Software Center and the version is called "texlive 2009-15". New questions:   * Has `Ligatures=TeX` replaced `Mapping=tex-text` in the very latest TeX distribution?   * Is there a better way to modify the original `defaultfonfeatures` line instead of simply removing `Ligatures=TeX`?   * How to get the `newfontfamily` command to work with Helvetica instead of Arial? What should be added to the class file?


title: ps2pdf -dEPSCrop input.eps cannot crop input with \pagecolor{<non-white>}

text: If I set `\pagecolor{}` to any color other than `white`, I will get a strange result.               rem batch.bat takes a file name without extension.     latex -interaction=nonstopmode %1     dvips -E %1 -o %1-temp.eps     epstool --copy --bbox %1-temp.eps %1.eps     ps2pdf -dEPSCrop %1.eps                    \documentclass{minimal}     \usepackage{pstricks}     \pagecolor{red}% please try white or disable it.     \begin{document}     \begin{pspicture}[showgrid=true](2,2)     \psframe(2,2)     \end{pspicture}     \end{document}      Is it a bug?


title: Use of the subfiles package results in a compilation error, due to the compiler erroneously parsing a commented-out "\end{document}"

text: I have the following two files in a folder: `mymainfile.tex`:               \documentclass{article}     \usepackage{subfiles}     \begin{document}     %\end{document}     \subfile{mysubfile.tex}     \end{document}      `mysubfile.tex`:               \documentclass[mymainfile.tex]{subfiles}     \begin{document}     hello     \end{document}      Compiling `mymainfile.tex` (using pdflatex) works fine, and includes the contents of `mysubfile.tex`, as it should. However, compiling `mysubfile.tex` on its own leads to the following error description:               ! LaTeX Error: Missing \begin{document}.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.3 h          ello     ?       I.e. the compiler acts just as if the line               %\end{document}      wasn't commented out. If this line is removed, both files compile fine. The fact that the compiler reads the commented-out line as if it wasn't a comment at all makes me very uneasy, I thought the fact that comments are consistently ignored by the compiler was the ONE thing I could always count on! What might be the reason?


title: MinionPro and beamer: figure selection

text: `MinionPro` package options for figure selection don't appear to work under `beamer`. I'd like text figures in text mode (`textosf`) and lining figures in math mode (`mathlf`). In the example below, the numbers in math mode appear as text figures, not lining figures as expected. I can hook figure selection into various commands/environments to get the desired effect, but this workaround (at least as I've implemented it) is messy. Is there a better solution?               \documentclass[serif,professionalfonts]{beamer}     %\documentclass{article}     \usepackage[mathlf,textosf]{MinionPro}     \DeclareMathAlphabet{\mathlf}{T1}{MinionPro-LF}{m}{n}          \begin{document}     \begin{frame}{Slide title}       Math mode: $012345$, \(012345\),       \[012345,\]       \begin{equation*}         012345.       \end{equation*}       Text mode: 012345.       Select lining figures: \figureversion{lf}012345, \(\mathlf{012345}\).     \end{frame}     \end{document}


title: Shaded with "continue on next page"

text: I am using the `shaded` environment in the `framed` package to wrap some text lines that may go across two different pages. If there is a crossing of pages, I'd like to automatically add a line "(continue on next page)" to the first shaded box. Is there an easy way to do so? Thank you.


title: Set music in LaTeX with ABC or LilyPond?

text: I’ll give a tutorial, “LaTeX for musicians”, in the next year and certainly I want the to show how to include music in their texts. I’m a musician myself but I never used LaTeX to typeset music. I found two ways to include music in a LaTeX document (plus: integrate music as image) and I want to share my thoughts and ask for some help (see below). First, let's take a more detailed look at both ways: ## ABC **Code**               % file abc.tex     \documentclass{scrartcl}     \usepackage{abc}          \begin{document}     Text     \begin{abc}[name=c-dur]     X: 1 % start of header     K: C % scale: C major     "Text"C4 G4 | (3FED c4 G2 |     \end{abc}     \end{document}      **Compile**               pdflatex --shell-escape abc.tex      **Output** ![ABC output](http://i.stack.imgur.com/tADnH.png) ## LilyPond **Code**               % file lp.lytex     \documentclass{scrartcl}          \begin{document}     Text     \begin[staffsize=12]{lilypond}     \relative c' {       c2^"Text" g'2 \times 2/3 { f8 e d } c'2 g4     }     \end{lilypond}     \end{document}      **Compile**               lilypond-book --output=out-dir --pdf lp.lytex     cd out-dir     pdflatex lp.tex      **Output** ![LilyPond output](http://i.stack.imgur.com/zTMPt.png) ## Comparison Now let’s talk about the pros and cons.   * The **ABC** workflow is much **easier** than the one of LilyPond and it simply needs a call of `pdflatex`. For this it’s preferable for the students of the tutorial since most of them aren't computer geeks.   * The **ABC syntax** seems to bee **easier** at a first glance.   * **LilyPond** uses the **right font** i.e. the font of the LaTeX document.   * **`abc.sty`** always produces a **_display style_ image**, i.e., it starts a new line and centers it’s content. Furthermore there seems to be now option to shorten the line that they fit just the typed notes and not span the whole `\linewidth` (workaround: set `width=0.5\abcwidth`).   * As far as I can see **LilyPond** is **more flexible** in the number of ways to typeset music ( _inline_ , _display style_ , …) and the possibilities of typesetting in general.   * The **LilyPond music font looks better** except the fat bar lines. ## Questions The numbers are not to give an order. I numbered the questions to make it easy to answer the …   1. Which way would you prefer to use? Which one do you suggest for students how a not very good in using computers?   2. I wonder if it will be possible to create a package that integrates LilyPond in the same way that `abc.sty` does width ABC notation   3. Can one change the font of the ABC output so that it matches the LaTeX main font?   4. Is there a way to make ABC find a good line length for the given number of notes?   5. Can one change the width of LilyPonds bar lines? ## Conclusion I’d prefer to use (and teach) the LilyPond way but I fear the compilation workflow would scare the students. So if question 2 could be solved it would be great :-) I hope you understand what I want since my english may be not the best. Please ask if something is not clear …


title: What are good advanced LaTeX books?

text: I've been using LaTeX for about 3 months, and I'm hooked. My background is programming, so for the basic, google is sufficient. I did some research on amazon.com and found these two books with many positive feedback:   LaTeX-Companion-Techniques-Computer-Typesetting   Guide to LaTeX (4th Edition) However, most of people said they are more like references than a real book. And if they really are, then I think I'd rather look up at CTAN. What I'm looking for is a book that can teach me how to program in LaTeX, for example:   1. Write my own package    2. Create animation    3. Create and using macro in LaTeX   .... I know there are many options around, however to pick the right one is not an easy task. Any advice or suggestion would be greatly appreciated. Thank you.


title: Using the itemize environment inside a caption

text: The following code does not compile. However, if I remove the `itemize` environment it does. I googled for this problem, and found suggestions that using the caption package would solve the problem, though I did not find any clear description of why the problem occurred in the first place. See for example http://www.latex-community.org/forum/viewtopic.php?f=45&t=8774 I'm using Debian squeeze with TeX Live 2009-11. The included version of `caption` has               \ProvidesPackage{caption}[2009/10/09 v3.1k Customizing captions (AR)]      I also tried downloading and using the `caption` package from http://www.ctan.org/tex-archive/macros/latex/contrib/caption/ but this doesn't change anything. I put the sty files in my current directory. I assume that overrides the system files. This one corresponds to               \ProvidesPackage{caption}[2010/01/09 v3.1m Customizing captions (AR)]      Error message and example file follow.               *******************************************         ERROR: Argument of \@caption has an extra }.          --- TeX said ---     <inserted text>                      \par      l.13     }          --- HELP ---     From the .log file...          I've run across a `}' that doesn't seem to match anything.     For example, `\def\a#1{...}' and `\a}' would produce     this error. If you simply proceed now, the `\par' that     I've just inserted will cause me to report a runaway     argument that might be the root of the problem. But if     your `}' was spurious, just type `2' and it will go away.     ******************************************************          \documentclass{article}     \usepackage{caption}     \begin{document}          \begin{figure}         \captionsetup{singlelinecheck=off}         \caption         {           foo           \begin{itemize}           \item bar           \end{itemize}         }     \end{figure}     \end{document}


title: Bad margins while printing

text: I'm using `geometry` package like this:               \usepackage[landscape]{geometry}     \newgeometry{twocolumn, left=0.25cm, right=0.25cm, top=0.8cm, bottom=0.4cm}      and `fancyhdr` package like this:               \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhf{}     \fancyhead[L]{\bf{Some text}}     \fancyhead[C]{\leftmark}     \fancyhead[R]{\thepage}     \fancyheadoffset[L]{0.42cm}     \fancyheadoffset[R]{-0.26cm}      And everything with margins is ok. But when I'm printing pdf on paper all margins is changing. How can I fix page margins for printing? All code looks like this:               \documentclass[8pt]{extarticle}          \usepackage[cp1251]{inputenc}          \usepackage[russian,english]{babel}          \usepackage[landscape]{geometry}          \usepackage{fancyhdr}          \pagestyle{fancy}          \fancyhf{}          \fancyhead[L]{\bf{Some text}}          \fancyhead[C]{\leftmark}          \fancyhead[R]{\thepage}          \fancyheadoffset[L]{0.42cm}          \fancyheadoffset[R]{-0.26cm}          \setlength{\headsep}{0.2cm}          \usepackage{listings}          \usepackage{color}          \definecolor{mygreen}{rgb}{0,0.6,0}          \definecolor{mygray}{rgb}{0.5,0.5,0.5}          \definecolor{myviolet}{rgb}{0.5,0,0.36}          \lstset{     backgroundcolor=\color{white},     language=C++,     keywordstyle=\color{myviolet},     commentstyle=\color{mygreen},     frame=single,     framerule=0.1pt,     rulecolor=\color{black},     breakatwhitespace=true,     breaklines=true,     numbers=left,     stepnumber=1,     numbersep=5pt,     numberstyle=\tiny\color{mygray},     showspaces=false,     showstringspaces=false,     showtabs=false,     tabsize=2,     framexleftmargin=10pt,     framexrightmargin=-10pt,          }          \usepackage{amsmath}          \begin{document}          \selectlanguage{russian}          \newgeometry{twocolumn, left=0.7cm, right=0cm, top=0.8cm, bottom=0.4cm}          \begin{lstlisting}     /* bfdlink.h -- header file for BFD link routines        Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,        2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011        Free Software Foundation, Inc.        Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.             This file is part of BFD, the Binary File Descriptor library.             This program is free software; you can redistribute it and/or modify        it under the terms of the GNU General Public License as published by        the Free Software Foundation; either version 3 of the License, or        (at your option) any later version.             This program is distributed in the hope that it will be useful,        but WITHOUT ANY WARRANTY; without even the implied warranty of        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        GNU General Public License for more details.             You should have received a copy of the GNU General Public License        along with this program; if not, write to the Free Software        Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,        MA 02110-1301, USA.  */          #ifndef BFDLINK_H     #define BFDLINK_H          /* Which symbols to strip during a link.  */     enum bfd_link_strip     {       strip_none,       /* Don't strip any symbols.  */       strip_debugger,   /* Strip debugging symbols.  */       strip_some,       /* keep_hash is the list of symbols to keep.  */       strip_all     /* Strip all symbols.  */     };          /* Which local symbols to discard during a link.  This is irrelevant        if strip_all is used.  */     enum bfd_link_discard     {       discard_sec_merge,    /* Discard local temporary symbols in SEC_MERGE                    sections.  */       discard_none,     /* Don't discard any locals.  */       discard_l,        /* Discard local temporary symbols.  */       discard_all       /* Discard all locals.  */     };          /* Describes the type of hash table entry structure being used.        Different hash table structure have different fields and so        support different linking features.  */     enum bfd_link_hash_table_type       {         bfd_link_generic_hash_table,         bfd_link_elf_hash_table       };          /* These are the possible types of an entry in the BFD link hash        table.  */          enum bfd_link_hash_type     {       bfd_link_hash_new,        /* Symbol is new.  */       bfd_link_hash_undefined,  /* Symbol seen before, but undefined.  */       bfd_link_hash_undefweak,  /* Symbol is weak and undefined.  */       bfd_link_hash_defined,    /* Symbol is defined.  */       bfd_link_hash_defweak,    /* Symbol is weak and defined.  */       bfd_link_hash_common,     /* Symbol is common.  */       bfd_link_hash_indirect,   /* Symbol is an indirect link.  */       bfd_link_hash_warning     /* Like indirect, but warn if referenced.  */     };          enum bfd_link_common_skip_ar_symbols     {       bfd_link_common_skip_none,       bfd_link_common_skip_text,       bfd_link_common_skip_data,       bfd_link_common_skip_all     };          struct bfd_link_hash_common_entry       {         unsigned int alignment_power;   /* Alignment.  */         asection *section;      /* Symbol section.  */       };          /* The linking routines use a hash table which uses this structure for        its elements.  */          struct bfd_link_hash_entry     {       /* Base hash table entry structure.  */       struct bfd_hash_entry root;            /* Type of this entry.  */       ENUM_BITFIELD (bfd_link_hash_type) type : 8;            unsigned int non_ir_ref : 1;            /* A union of information depending upon the type.  */       union         {           /* Nothing is kept for bfd_hash_new.  */           /* bfd_link_hash_undefined, bfd_link_hash_undefweak.  */           struct         {           /* Undefined and common symbols are kept in a linked list through              this field.  This field is present in all of the union element              so that we don't need to remove entries from the list when we              change their type.  Removing entries would either require the              list to be doubly linked, which would waste more memory, or              require a traversal.  When an undefined or common symbol is              created, it should be added to this list, the head of which is in              the link hash table itself.  As symbols are defined, they need              not be removed from the list; anything which reads the list must              doublecheck the symbol type.                   Weak symbols are not kept on this list.                   Defined and defweak symbols use this field as a reference marker.              If the field is not NULL, or this structure is the tail of the          \end{lstlisting}          \end{document}      Command line for compiling: latex a.tex dvipdfm a.dvi


title: How to center the graphic of LTXexample?

text: ## Scenario I want to write a tutorial on PSTricks, but because `latex-dvips-ps2pdf` (see the code shown in First Attempt section) makes my effort to prevent reader from copying the listing numbers no longer work               \usepackage{accsupp}     \newcommand*{\noaccsupp}[1]{\BeginAccSupp{ActualText={}}#1\EndAccSupp{}}      and I cannot use `microtype` and the output is a bit strange as follow ![enter image description here](http://i.stack.imgur.com/tLRtD.png) As a result, this problem forced me to use `pdflatex` (see Second Attempt section). ## First Attempt (latex-dvips-ps2pdf)               \documentclass[dvipsnames,border=12pt,preview]{standalone}          \usepackage{pstricks}     \usepackage{showexpl}     \usepackage{accsupp}     \newcommand*{\noaccsupp}[1]{\BeginAccSupp{ActualText={}}#1\EndAccSupp{}}          \makeatletter     \newlength{\parindent@save}     \setlength{\parindent@save}{\parindent}          \lstdefinestyle{PSTricks}     {         language={[LaTeX]TeX},         alsolanguage={PSTricks},         basicstyle=\small\ttfamily\null,         keywordstyle=\color{blue},         backgroundcolor=\color{yellow!10},         numbers=left,         numbersep=1em,         numberstyle=\tiny\color{Red}\noaccsupp,         frame=single,         framesep=\fboxsep,% expands outward, cannot affect if frame=none         framerule=\fboxrule,% expands outward, cannot affect if frame=none         rulecolor=\color{red},% cannot affect if frame=none         xleftmargin=\dimexpr\fboxsep+\fboxrule,         xrightmargin=\dimexpr\fboxsep+\fboxrule,         breaklines=true,         breakindent=0pt,         tabsize=5,         columns=flexible,         preset={\setlength{\parindent}{\parindent@save}\centering},     }     \makeatother               \begin{document}     \LTXexample[pos=t,style=PSTricks]     \begin{pspicture}[showgrid](3,3)         \pscircle[linecolor=red](1.5,1.5){1.5}     \end{pspicture}     \endLTXexample     \end{document}      ## Second Attempt (pdflatex) Using `pdflatex` can prevent users from copying the listing numbers. However, `preset=\centering` is no longer work when I use `graphic.`               \documentclass[dvipsnames,border=12pt,preview]{standalone}          \usepackage{xcolor}     \usepackage{showexpl}     \usepackage{accsupp}     \newcommand*{\noaccsupp}[1]{\BeginAccSupp{ActualText={}}#1\EndAccSupp{}}          \makeatletter     \newlength{\parindent@save}     \setlength{\parindent@save}{\parindent}          \lstdefinestyle{PSTricks}     {         language={[LaTeX]TeX},         alsolanguage={PSTricks},         basicstyle=\small\ttfamily\null,         keywordstyle=\color{blue},         backgroundcolor=\color{yellow!10},         numbers=left,         numbersep=1em,         numberstyle=\tiny\color{Red}\noaccsupp,         frame=single,         framesep=\fboxsep,% expands outward, cannot affect if frame=none         framerule=\fboxrule,% expands outward, cannot affect if frame=none         rulecolor=\color{red},% cannot affect if frame=none         xleftmargin=\dimexpr\fboxsep+\fboxrule,         xrightmargin=\dimexpr\fboxsep+\fboxrule,         breaklines=true,         breakindent=0pt,         tabsize=5,         columns=flexible,         preset={\setlength{\parindent}{\parindent@save}\centering},     }               \makeatother               \usepackage{filecontents}     \begin{filecontents*}{diagram.tex}     \documentclass[pstricks,border=12pt]{standalone}     \begin{document}     \begin{pspicture}[showgrid](3,3)         \pscircle[linecolor=red](1.5,1.5){1.5}     \end{pspicture}     \end{document}     \end{filecontents*}          \immediate\write18{latex diagram.tex && dvips diagram.dvi && ps2pdf  diagram.ps}               \begin{document}     \LTXinputExample[pos=t,style=PSTricks,graphic={[scale=1]"diagram"}]{diagram.tex}     \end{document}      **Original Output:** ![enter image description here](http://i.stack.imgur.com/UkxW8.png) **Expected Output:** ![enter image description here](http://i.stack.imgur.com/KwTj1.png) ## Question How to center the graphic of `\LTXexample` for the code shown in the Second Attempt section?


title: why do I get 'Undefined control sequence' for KOMAoptions?

text: I am trying to include A3 pages in an A4 LaTeX document (following this answer) but get the following when I run `pdflatex`:               Chapter 1.     [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2]     ! Undefined control sequence.     \AP@ ->{ \clearpage \KOMAoptions                                   {paper=a3,paper=landscape} \recalctypearea ...     l.27 \end{document}          ?      SSCCE below:               \documentclass[11pt,twoside,a4paper,pagesize]{report}     \usepackage{pslatex,palatino,avant,graphicx,color,nextpage,afterpage,comment}     \usepackage[margin=2cm]{geometry}     \usepackage[absolute]{textpos}     \usepackage[hyphens]{url}     \PassOptionsToPackage{hyphens}{url}          \begin{document}     \chapter{Introduction}     foo     \clearpage     bar          \afterpage{ % Insert after the current page     \clearpage     \KOMAoptions{paper=a3,paper=landscape}     \recalctypearea     A3 stuff goes here ...     \clearpage     \KOMAoptions{paper=A4,pagesize}     \recalctypearea     }               \end{document}      I understand that "undefined control sequence" means I've forgotten to use some package on my document preamble. However it is not clear to me what's wrong in this case.


title: Vertical Spacing within align environment accounting for fractions

text: The default vertical spacing within an `align` environment seems very tight when there are fractions in the lines. ![enter image description here](http://i.stack.imgur.com/EZyw1.png) I am aware of three manual tweaks that can be applied:   1. Adjust the value `\jot`.   2. Add a vertical space on each line where necessary via `\\\\[<amount>]`.   3. Use the `spreadlines` environment from the mathtools package. ![enter image description here](http://i.stack.imgur.com/gfE5G.png) Solutions 1 and 3 add vertical space even between the lines that don't need them, so if the set of equations has lines without fractions (and lines with fractions), the spacing is not quite right. ## Question: Is there not some automated solution to always leave the appropriate vertical space between the bottom of one line and the top of the next? ## References:   * Length parameter for vertical skip space in a math environment?   * How to make formulae take equal vertical space in the align environment? ## Code:               \documentclass{article}     \usepackage{mathtools}% includes amsmath          \begin{document}     \begin{minipage}[t]{0.20\linewidth}     \textbf{Nice}     \begin{align*}      x &= 73 \times 2\\        &= 146     \end{align*}     \end{minipage}%     %     \begin{minipage}[t]{0.25\linewidth}     \textbf{Not so nice}     \begin{align*}      x &= \frac{146}{10}\\        &= \frac{73}{5}     \end{align*}     \end{minipage}%               \bigskip\par\noindent     \textbf{Manual Tweak Options:}     \medskip\par\noindent     \begin{minipage}[t]{0.25\linewidth}     \textbf{Tweak jot}     \setlength{\jot}{8pt}% tweak     \begin{align*}      x &= \frac{146}{10}\\        &= \frac{73}{5}     \end{align*}     \end{minipage}%     %     \begin{minipage}[t]{0.30\linewidth}     \textbf{Add vertical space}     \begin{align*}      x &= \frac{146}{10}\\[5pt]% tweak        &= \frac{73}{5}     \end{align*}     \end{minipage}%     %     \begin{minipage}[t]{0.30\linewidth}     \textbf{spreadlines}     \begin{spreadlines}{0.8em}% tweak     \begin{align*}      x &= \frac{146}{10}\\        &= \frac{73}{5}     \end{align*}     \end{spreadlines}     \end{minipage}%     \end{document}      * * * ## Testing Proposed fix: I tested the proposed fix, and it does seem to fix the "Not so nice" section: ![enter image description here](http://i.stack.imgur.com/8IdRL.png) Not sure I like the additional vertical space at the top. But furthermore, it also adds spacing where it is not needed as was the case in the section that was previously "Nice": ![enter image description here](http://i.stack.imgur.com/quDPC.png) In cases where there are manual adjustments, they should probably not be extended (or only extended if the spacing is not sufficient. Personally I can work without this, but perhaps a method of disabling it would be good: ![enter image description here](http://i.stack.imgur.com/ugDwp.png) ## Code:               \documentclass{article}     \usepackage{mathtools}% includes amsmath          \begin{document}     \par\noindent     %---------------------------------------- Oringally "Nice"     \begin{minipage}[t]{0.30\linewidth}     \textbf{Nice}     \begin{align*}      x &= 73 \times 2\\        &= 146     \end{align*}     \end{minipage}%     %     \begin{minipage}[t]{0.30\linewidth}     \makeatletter         \def\align@preamble{%            &\hfil             \setboxz@h{\@lign$\m@th\displaystyle{##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \tabskip\z@skip            &\setboxz@h{\@lign$\m@th\displaystyle{{}##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \hfil             \tabskip\alignsep@         }%     \makeatother     %     %     \textbf{With 2012-05-09 fix:}     \begin{align*}      x &= 73 \times 2\\        &= 146     \end{align*}     \end{minipage}%          \bigskip\par\noindent     %---------------------------------------- Oringally "Not so Nice"     \begin{minipage}[t]{0.30\linewidth}     \textbf{Not so nice}     \begin{align*}      x &= \frac{146}{10}\\        &= \frac{73}{5}     \end{align*}     \end{minipage}%     %     \begin{minipage}[t]{0.30\linewidth}     \makeatletter         \def\align@preamble{%            &\hfil             \setboxz@h{\@lign$\m@th\displaystyle{##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \tabskip\z@skip            &\setboxz@h{\@lign$\m@th\displaystyle{{}##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \hfil             \tabskip\alignsep@         }%     \makeatother     %     \textbf{With 2012-05-09 fix:}     \begin{align*}      x &= \frac{146}{10}\\        &= \frac{73}{5}     \end{align*}     \end{minipage}%                    \bigskip\par\noindent     \textbf{Manual Tweak Options:}     \medskip\par\noindent     %---------------------------------------- Adjust \jot     \begin{minipage}[t]{0.30\linewidth}     \textbf{Tweak jot}     \setlength{\jot}{8pt}% tweak     \begin{align*}      x &= \frac{146}{10}\\        &= \frac{73}{5}     \end{align*}     \end{minipage}%     %     \begin{minipage}[t]{0.30\linewidth}     \makeatletter         \def\align@preamble{%            &\hfil             \setboxz@h{\@lign$\m@th\displaystyle{##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \tabskip\z@skip            &\setboxz@h{\@lign$\m@th\displaystyle{{}##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \hfil             \tabskip\alignsep@         }%     \makeatother     %     \textbf{With 2012-05-09 fix:}     \setlength{\jot}{8pt}% tweak     \begin{align*}      x &= \frac{146}{10}\\        &= \frac{73}{5}     \end{align*}     \end{minipage}%     %          %---------------------------------------- Adding Vertical Space     \bigskip\par\noindent     \begin{minipage}[t]{0.30\linewidth}     \textbf{Add vertical space}     \begin{align*}      x &= \frac{146}{10}\\[5pt]% tweak        &= \frac{73}{5}     \end{align*}     \end{minipage}%     %     \begin{minipage}[t]{0.30\linewidth}     \makeatletter         \def\align@preamble{%            &\hfil             \setboxz@h{\@lign$\m@th\displaystyle{##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \tabskip\z@skip            &\setboxz@h{\@lign$\m@th\displaystyle{{}##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \hfil             \tabskip\alignsep@         }%     \makeatother     %     \textbf{With 2012-05-09 fix:}     \begin{align*}      x &= \frac{146}{10}\\[5pt]% tweak        &= \frac{73}{5}     \end{align*}     \end{minipage}%               %---------------------------------------- Spreadlines     \bigskip\par\noindent     \begin{minipage}[t]{0.30\linewidth}     \textbf{spreadlines}     \begin{spreadlines}{0.8em}% tweak     \begin{align*}      x &= \frac{146}{10}\\        &= \frac{73}{5}     \end{align*}     \end{spreadlines}     \end{minipage}%     %     \begin{minipage}[t]{0.30\linewidth}     \makeatletter         \def\align@preamble{%            &\hfil             \setboxz@h{\@lign$\m@th\displaystyle{##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \tabskip\z@skip            &\setboxz@h{\@lign$\m@th\displaystyle{{}##}$}%             \ifdim\ht\z@<\ht\strutbox@             \ht\z@\ht\strutbox@             \dimen@\ht\strutbox@             \advance\dimen@.15em             \ht\strutbox@\dimen@             \fi             \strut@             \ifmeasuring@\savefieldlength@\fi             \set@field             \hfil             \tabskip\alignsep@         }%     \makeatother     %     \textbf{With 2012-05-09 fix:}     \begin{spreadlines}{0.8em}% tweak     \begin{align*}      x &= \frac{146}{10}\\        &= \frac{73}{5}     \end{align*}     \end{spreadlines}     \end{minipage}%     \end{document}


title: Ignore commands when compiling

text: I have defined some custom commands that I use for TODO-notes. If I write a note i use the command `\stefan{}`. Now I want to define a new command, for example `\supervisor{}`. I need a way to get LaTeX to ignore either one of the commands. When `\supervisor` is disabled I will want the `\stefan` command to get compiled. Is this even possible?


title: Ugly bond joints in chemfig

text: Making my first scientific poster I have noticed that Chemfig does not join bonds in a very aesthetic way (see attached image). How can I avoid the small gaps shown here, and make sure the transition between bonds is smooth? ![enter image description here](http://i.stack.imgur.com/WbiLF.png) MWE as requested:               \documentclass{standalone}     \usepackage{chemfig}     \begin{document}     \chemfig{-[:30]-[:-30]}     \end{document}


title: mdframed causes "too many floats" error

text: I defined a new environemnt `examples` for a book I am writing. I would like examples to be with a framed grey box, and use the following construct               %----------------------------------------------------------------------------     % EXAMPLES     %----------------------------------------------------------------------------     \newlistof[chapter]{examples}{exp}{\listexamples}     \newcommand{\bex}[1]{%     \begin{mdframed}[linewidth=2, leftmargin=0, rightmargin=0, backgroundcolor=gray, linecolor=black, splittopskip=\topskip, skipbelow=\baselineskip, skipabove=\baselineskip]     \refstepcounter{examples}     \par\noindent\sqrblt\underline{\textbf{Example \theexamples. #1}}     \addcontentsline{exp}{examples}     {\protect\numberline{\theexamples}#1}\par}     \cftsetindents{examples}{0em}{2em} % for example numbers which are greater than 9     % Solution     \newcommand{\sol}{\begin{center}\underline{{\bf Solution:}}\end{center}}     % End of Example     \newcommand{\eex}{     \noindent \hbox{~~}\hfill \hbox{~~} \sqrblt     \end{mdframed}     }      If I activate the `mdframed`, I get "not in outer par mode". If I comment the `mdframed` part, all is well


title: Nomenclature errors in Lyx, don't try to define the nomenclature in a heading/subheading

text: While trying to view my document in Lyx I kept getting an error while compiling the document: > LaTex Error: Lonely\item--perhaps a missing list environment The descriptions stated:               \item [{BER}]                    \begingroup Bit Error Rate\nomeqref {42}\nompageref{16}     Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.      By using the note feature (commenting out) on each of the nomenclature entries I found that I'd tried to define a nomenclature within a subsection title. Commenting out the nomenclature entry allowed the document to compile and I could see my list.


title: Cross-referencing issue with subcaption in beamer

text: Thank you in advance and support that provides this website for the tex users. I am a new member of the tex society almost a year now and I can say that most of my answers related to my problems have been answered previously here. Your work is really impressing taken in consideration that people are sharing knowledge for free. Recently I came across with a problem that I think it is a bug of the system. I was trying to create a beamer presentation and by using `\usepackage{subcaption}` and `\begin{subfigure}` environment. While I was trying to use the `\label` and `\ref` points to my _subfigure(s)_ I noticed that only the first `\label` was operating correctly as _1a_. Unfortunately the rest are coming up as _??_. I assume this is because the `\ref` points are located before the `\label`, but in this case all of them should not be operating correctly all should fail. I was not able to find an answer relative to my question no matter how much I searched for. Maybe it is a bug of the system. I was just hopping that you could provide more information and maybe a solution to overcome this problem. More information and the testing code can be found here: Multiple \label commands before \ref.               \documentclass[xcolor=pdftex,dvipsnames,table]{beamer}     \usepackage[english]{babel}     \usepackage{hyperref}     \usepackage{cleveref}     \usepackage{caption}     \usepackage{subcaption}          \mode<presentation>     \setbeamertemplate{caption}[numbered]          \begin{document}     \begin{frame}      \begin{columns}[t]      \begin{column}[T]{5cm}      \begin{itemize}      \item<+-| alert@+> 1~\autoref{1}      \item<+-| alert@+> 2~\autoref{2} etc      \end{itemize}      \end{column}      \begin{column}[T]{5cm}      \begin{figure}      \only<1>{\begin{subfigure}[b]{1.0\linewidth}               \caption{sub caption 1}               \label{1}               \includegraphics[width=7.0cm,height=5cm]{fig 1}               \end{subfigure} }      \only<2>{\begin{subfigure}[b]{1.0\linewidth}               \caption{sub caption 2}               \label{2}               \includegraphics[width=5.5cm,height=5cm]{fig 2}               \end{subfigure} }     \caption{main}      \protect\label{3}      \end{figure}      \end{column}      \end{columns}      \end{frame}     \end{document}


title: Process and plot data in different files using pfgplots

text: I like to read in my x-y-data from different files and then process them somehow. I read different questions here on each topic (data using from different files and processing data) but I somehow can't manage throwing them together. The following MWE works but I can't process the data. I loaded the x-y-data seperately into \xData and \yData but I can't get them to be plotted as they are seperated. The data I can get plotted I can't process...               \documentclass{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{pgfplots, pgfplotstable}          \listfiles          \begin{document}          \begin{tikzpicture}          \pgfplotstableset{     create on use/y/.style={create col/copy column from table={chi_probe.dat}{0}}     }          \pgfplotstableread{grid_omega_opt.dat}\xData;     \pgfplotstableread{chi_probe.dat}\yData;          \begin{axis}[     width=0.85\linewidth,     height=8cm     ]          \addplot[black, smooth] table [y=y] {grid_omega_opt.dat};          \end{axis}          \end{tikzpicture}          \end{document}


title: JabRef multi-author glitches?

text: I'm using JabRef to do all my referencing, but sometimes the `.bib` files I download gives weird author outputs. For example, I want the author field to look like (as appeared in Google Books): > Monegon, Ltd, F.A. Costello, Inc, Bird Engineering-Research Associates, > United States. National Aeronautics and Space Administration Instead I get: > Monegon, L.; F.A. Costello, I.; Associates, B. E.-R.; Aeronautics, U. S. N. > & Administration, S. I understand that these aren't conventional authors, but is there a way to stop JabRef from formatting the author field? Thanks!


title: Centering first line of an align environment (Simulating \multicolumn{2}{c})

text: I often need align environments where the first line is centered, e.g., when first introducing the types of the functions to be defined, then defining them. I essentially want to obtain the effect that `\multicolumn{2}{c}` has in a table, but in an align environment. The below solution is as far as I got, but the first line is then not centered. I could put them into separate environments, but this would mess with spacing in a way that I would like to avoid.               \documentclass{article}     \usepackage{amsmath}     \begin{document}          \begin{align*}     \omit \rlap{$f: A \to B, g: B \to C$}\\     f(a) &= \ldots \\     g(b) &= \ldots      \end{align*}          \end{document}      Any insight is appreciated. I don't really need the full power of a multicolumn command, but I want to be able to insert centered lines in an align environment.


title: Vertical alignment in multicol

text: In the following code the horizontal rules on the right don't line up in all cases with the horizontal rules on the left. It seems to be related to the text content. How can I fix this in such a way that it works regardless of what the text is. Thanks.               \documentclass{article}     \usepackage[top=1in,bottom=1in,left=0.5in,textwidth=7.5in]{geometry}     \usepackage{multicol}     \usepackage{tabu}     \usepackage{xcolor}     \begin{document}          \setlength{\columnseprule}{.4pt}      \renewcommand\columnseprulecolor{\color{blue}}     \begin{multicols}{2}     \tabulinesep=4pt\begin{tabu} to \columnwidth{>{\bfseries}lX}      \everyrow{\tabucline[blue]-}     Some words & and some more \\      Some words & and some more \\      Some words & and some more \\      Some words & and some more \\      Some words & and some more \\      \end{tabu}      \tabulinesep=4pt\begin{tabu} to \columnwidth{>{\bfseries}lX}      \everyrow{\tabucline[blue]-}     Some words & and some more \\      Some words & and some more \\      Some words & and some more \\      Some words & more / words \\      Some words & and some more \\      \end{tabu}      \end{multicols}      \end{document}      Output looks like this: ![screenshot](http://i.stack.imgur.com/Xq9Yv.png) **ADDED:** David Carlisle brought up the issue of multiline content so using his code I tried this. Note that it does not line up. It may be that cases such as this where there is multiline content cannot be aligned in a general way but if it is possible it would be interesting to know how to do it.               \documentclass{article}     \usepackage[top=1in,bottom=1in,left=0.5in,textwidth=7.5in]{geometry}     \usepackage{lipsum}     \usepackage{multicol}     \usepackage{tabu}     \usepackage{xcolor}     \begin{document}          \setlength{\columnseprule}{.4pt}      \renewcommand\columnseprulecolor{\color{blue}}     \begin{multicols}{2}     \tabulinesep=4pt     \noindent     \begin{tabu} to \columnwidth{>{\bfseries}l>{\strut\ignorespaces}X<{\ifhmode\unskip\strut}}      \everyrow{\tabucline[blue]-}     Some words & and some more \\      Some words & and some more \\      Some words & and some more \\      Some words & and some more \\      Some words & and some more \\      Some words & and some more \\      \end{tabu}      \tabulinesep=4pt     \noindent     \begin{tabu} to \columnwidth{>{\bfseries}l>{\strut\ignorespaces}X<{\ifhmode\unskip\strut}}      \everyrow{\tabucline[blue]-}     Some words & and some more \\      Some words &  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu- lum ut, placerat ac, adipiscing vitae, felis. \\     Some words & and some more \\      Some words & more / words \\      Some words & and some more \\      \end{tabu}      \end{multicols}      \end{document}      which gave this: ![screenshot](http://i.stack.imgur.com/8USEC.png)


title: Strange behaviour of binomial coefficient's delimiters

text: While writing down my Combinatorics exercises I found that the binomial coefficient's delimiters weren't displayed as indicated inside the `amsmath` documentation. By subsequent trials and errors I was able to reduce the volume of my document to this simpler and fully compilable MWE:               \documentclass[11pt]{article}     %     \usepackage{amsmath}     %     \makeatletter     %     \usepackage{lmodern}     \usepackage{lipsum}     %     \makeatother     %     \begin{document}     %     \lipsum[1]     \begin{equation}     2^k-\binom{k}{1}2^{k-1}+\binom{k}{2}2^{k-2}     \end{equation}     \lipsum[1]     %     \end{document}      Which gives (using TeXworks 0.44 on MikTeX 2.9.4521 updated 09/10/13) this un- expected result: > ![enter image description here](http://i.stack.imgur.com/bbbwc.png) While the `amsmath` doc shows that with the loaded packages inside the MWE the result would actually be like this: > ![enter image description here](http://i.stack.imgur.com/MwhRo.png) From here we can see that the delimiters on the first example are a little bit stretched vertically as they surpass the arguments inside the binom. coeff. The more strange event is that when I comment the line `\usepackage{lmodern}` the result on delimiter's shape in my example looks exactly as the `amsmath` doc:               \documentclass[11pt]{article}     %     \usepackage{amsmath}     %     \makeatletter     %     %\usepackage{lmodern}     \usepackage{lipsum}     %     \makeatother     %     \begin{document}     %     \lipsum[1]     \begin{equation}     2^k-\binom{k}{1}2^{k-1}+\binom{k}{2}2^{k-2}     \end{equation}     \lipsum[1]     %     \end{document}      Output: > ![enter image description here](http://i.stack.imgur.com/hj2ZF.png) From here I deduce that the problem lies inside `lmodern`, but I'd like to keep using this package and fix this wierd "issue" with the math mode. Is there some clue that I've missed or this is in fact an update-process bug infecting `amsmath`'s delimiter control?


title: tabularx doesn't break rows correctly

text: I've got some problems with tabularx. I need a table with 4 columns and the last one should contain a lot of text so I need it to break rows automaticly. And from my reasearch I thought that it should work like shown in my example below. But when I render this example the row gets broken before "even more..." and the row above only shows the text until "and on and on.... the" Does anyone know why the row gets broken "too late"? here is my example:               \begin{table}[hb]     \begin{tabularx}{15cm}{lllX}\\     \textbf{name1}  &  \textbf{name2}   &  \textbf{name3}& \textbf{name4}   \\  \hline     1   &  & some text & a really long text for a table and it goes on and on and on.... there is some more text and even more..... \\          \end{tabularx}     \caption{table cation}     \label{tab:tablecaption}     \end{table}      Thanks for any help!


title: Page numbers (Roman number and Arabic numerals) in ConTeXt

text: My simple document is divided into only two parts (it's only some math notes).               \starttext     % frontmatter     \startstandardmakeup     ... % the cover     \stopstandardmakeup     \completecontent     \startbodymatter     ... % main part     \stopbodymatter     \stoptext      I hope that the page number in `frontmatter` can be `Roman numbers` which start from the contents `not the standardmakeup` so I can achieve this by this:               \startfrontmatter     ...     \stopstandardmakeup     \setupuserpagenumber[numberconversion=romannumerals]     \completecontent     \stopfrontmatter     \startbodymatter     % some settings?     ...      and I also hope that the page numbers in `bodypart` can be from `Arabic numeral 1`, how can I achieve this? more clearly: when ConTeXt enters the `bodymatter`, can I reset the page numbers so that it can start from 1?


title: How do I force a column-break in a multi-column page?

text: I want to display my article's abstract and table of contents side-by-side, to save space. I'm using the `multicols` package, but it tries to keep each column the same height, and I can't figure out how to force it to move content into the second column. Here's a mockup; I'm just padding out the abstract to show what it should look like. The layout is perfect, I just want a way to do this properly:               \begin{document}     \maketitle          \begin{multicols}{2}     \section*{Abstract}          \lipsum[1-2]          a % padding to make the first column run to       % end of page     a          a          a          a          a          a          a          a          a          a          a          a          \tableofcontents     \end{multicols}      And here's what it looks like, rendered (perfect except for the padding lines): ![Result](http://i.stack.imgur.com/Mh88g.png)


title: Good typesetting practice for long equations

text: I have the following (quite horrible) equation in my thesis:               \begin{align*}     \frac{\partial^2}{\partial t_1^2} f(t_0,t_1) =      ( \delta+2t_0+2t_1)^{\alpha( w-t_0+t_1 )-1} \cdot \bigl(       \frac{\partial^2}{\partial t_1^2}\alpha(w-t_0+t_1) \cdot ( \delta+2t_0+2t_1) \cdot  \log ( \delta+2t_0+2t_1) +\\     \alpha'(w-t_0+t_1) \cdot 2 \cdot  \log ( \delta+2t_0+2t_1)+     \alpha'(w-t_0+t_1) \cdot ( \delta+2t_0+2t_1) \cdot  \frac{2}{\delta+2t_0+2t_1} +\\     2 \frac{\partial}{\partial t_1} \alpha( w-t_0+t_1 ) \bigr) +     ( \delta+2t_0+2t_1)^{\alpha( w-t_0+t_1 )-2}\cdot\\      \bigl( \frac{\partial}{\partial t_1} \alpha(w-t_0+t_1) \cdot ( \delta+2t_0+2t_1) \cdot \log ( \delta+2t_0+2t_1) + (\alpha (w-t_0+t_1) -2) \bigr) \cdot \\     \bigl( \alpha'(w -t_0+t_1) \cdot ( \delta+2t_0+2t_1) \cdot  \log ( \delta+2t_0+2t_1) +     2\alpha( w-t_0+t_1)\bigr) = \\     ( \delta+2t_0+2t_1)^{\alpha( w-t_0+t_1 )-1} \cdot \Bigl(       \frac{\partial^2}{\partial t_1^2}\alpha(w -t_0+t_1) \cdot ( \delta+2t_0+2t_1) \cdot  \log ( \delta+2t_0+2t_1) +\\     2 \cdot \alpha'(w-t_0+t_1)  \cdot  \bigl( 2 + \log ( \delta+2t_0+2t_1) \bigr) \Bigr) +     ( \delta+2t_0+2t_1)^{\alpha( w-t_0+t_1)-2} \cdot \Bigl( \\     \alpha '(w-t_0+t_1) \cdot      (\delta + 2t_0+2t_1) \cdot \log (\delta + 2t_0+2t_1) +       \bigl(\alpha (w-t_0+t_1) -2) \bigr) \cdot      \bigl(   \\     \alpha'(w-t_0+t_1) \cdot ( \delta+2t_0+2t_1) \cdot  \log ( \delta+2t_0+2t_1) +2\alpha( w-t_0+t_1)\bigr) \Bigr)  < 0     \end{align*}      Using this exact piece of code, without any special formatting commands such as & or \[2mm] the resulting mathematical text is quite unreadable: ![The equation](http://i.stack.imgur.com/XvW2n.png) How would you format such equations in LaTeX and what would you say is good practice when typesetting such large equations?


title: Alignment between material inside and outside a cases environment

text: In the code below, I'd like to make the `i=0,\ldots,n.` line up, in the output, with the cases in the first part of the definition. Ideally, the full- stop would align with the semicolons and comma.               \documentclass{article}     \usepackage{mathtools}          \begin{document}          \begin{align*}     d_i(g_n,\ldots,g_0) &=     \begin{cases}      (d_0g_ng_{n-1},g_{n-2},\ldots,g_0),& \text{if $i=0$;}\\     (d_ig_n,\ldots,d_1g_{n-i+1},d_0g_{n-i}g_{n-i-1},g_{n-i-2},\ldots,g_0), \\        & \phantom{\text{if $i=0$;}}\llap{\text{if  $i=1,\ldots,n-1$;}} \\       (d_ng_n,\ldots,d_1g_1),& \text{if $i=0$,}      \end{cases}     \intertext{and}       s_i(g_n,\ldots,g_0) &= (s_ig_n,\ldots,s_0g_{n-i},id_{G_{n-i}},g_{n-i-1},\ldots,g_0),\quad i=0,\ldots,n.     \end{align*}          \end{document}


title: pdfTeX and JPEG2000

text: In Which graphics formats can be included in documents processed by latex or pdflatex?, the answers indicate that that pdfLaTeX understands JPEG2000. For me it doesn't work and the above link seems to be about the only place where a `.jp2`-positive statement is made. Could someone please clarify the matter for me?


title: Weird behaviour of copying - no space between words

text: \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{tgtermes}     \begin{document}          Polska, Rzeczpospolita Polska -- państwo unitarne w Europie Środkowej,     położone między Morzem Bałtyckim na północy a Sudetami i Karpatami na południu,     w dorzeczu Wisły i Odry. Powierzchnia administracyjna Polski wynosi 312 679 km$^2$,     co daje jej 70.\ miejsce na świecie i dziewiąte w Europie.     Zamieszkana przez ponad 38,5 miliona ludzi, zajmuje pod względem liczby     ludności 34.\ miejsce na świecie, a szóste w Unii Europejskiej.          \end{document}      In Sumatra PDF when I try to copy and paste I get:               Polska, Rzeczpospolita Polska – państwo unitarne w Europie Środkowej, położone     międzyMorzemBałtyckimnapółnocyaSudetamiiKarpataminapołudniu,wdorzeczu     Wisły i Odry. Powierzchnia administracyjna Polski wynosi 312 679 km2, co daje jej     70. miejsce na świecie i dziewiąte w Europie. Zamieszkana przez ponad 38,5 miliona     ludzi, zajmuje pod względem liczby ludności 34. miejsce na świecie, a szóste w Unii     Europejskiej      In some places there is no space between words. The problem is not visible when just looking at the output pdf. It only happens when you try to copy a text. In Acrobat Reader I don't see this problem. What is more, the problem is not present when I remove `tgtermes` so it is not entirely fault of the reader. Any way to fix this?


title: Moving from PC to Mac: BibTeX problem

text: I recently bought a Mac and have been struggling with running my `.tex` files. I'm using `Textmate` and `TeXShop`. The problem I have is the following: using the exact same `.tex` and `.bib` files and running them on my Mac, some of the references do not appear. For example, at some point a type: Eg. `\citet{heckman81}` and `\citet{heckman81a}`, and after running both `pdflatex` and `bibtex` (several times, as suggested elsewhere) I get the following warning:               Warning--I didn't find a database entry for "heckman81a"      Importantly, when I use to run it on my PC everything worked fine. Anyone has suggestions, or has experienced something similar in the past?


title: How do I force tikz to use CMYK everywhere (also in shadings)?

text: I'm doing a poster with the `baposter` which uses `tikz` and at some point realized that some colors that should be identical are not. It turns out that `tikz` apparently resorts to RGB color space as soon as there is a shading involved, whereas I'm doing the poster (a I intend to print it...) in CMYK (which is also the default in the `baposter` class). Now my question is: How do I force `tikz` to use CMYK everywhere? Here's a minimal example that demonstrates the problem:               \documentclass{minimal}          %%% uncomment to use CMYK     \usepackage[cmyk]{xcolor}     \definecolor{mygreen}{cmyk}{1,0,0.57,0.42}           %%% uncomment to use RGB     % \usepackage[rgb]{xcolor}     % \definecolor{mygreen}{HTML}{009440}          \usepackage{tikz}          \pdfcompresslevel=0          \begin{document}          \color{mygreen}{MY TEXT}          \tikz        \shade [left color=mygreen,right color=mygreen]        (1,1) rectangle (2,2);     %     \tikz        \fill [mygreen]        (1,1) rectangle (2,2);          \end{document}      The two boxes, which should have the same color, have not. The shaded box should have the same color as the solid box and the text. (Note: this question is not so much about the `baposter` class, however, as `baposter` uses `tikz` the underlying problem leads to the fact that the frames of the boxes and the shadings in the header of the boxes have different colors.)


title: Automatic break/hyphen for too long meaningless words

text: Since there is no pattern for hyphening meaningless words, they should be individually hyphenated/broken with methods such as `\hyphenation{longword}`, \seqsplit{longword}, etc. However, there should be a solution to do this automatically, because the need for hyphenation/breaking depends on the place of a word, and it is not easy to make individual hyphenation for any word that might be placed at the end of line.               \documentclass{article}     \begin{document}     This is a test for a word which is too long at the end of a line aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\     This is a test for a word which is too long at the end of a line http://test.com/3/3/3/3/3/3/3/3/3/3/3/3/3/3/3/3/3/3\\     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa This is a test for a word which is too long at the end of a line\\     http://test.com/3/3/3/3/3/3/3/3/3/3/3/3/3/3/3/3/3/3 This is a test for a word which is too long at the end of a line\\     \end{document}      As you can see, hyphenation/breaking can be unnecessary or extremely necessary. In fact, there should be a way to forbid continuing the text to margin. This is what text editors like MS Word do. I know `Tex` is far beyond compare to MS Word, but it can give a clue. I thin if sending the long word to the next line is better than writing it on the margin and beyond. The problem appear when there are many words of this kind, and it is quite difficult to treat them individually.


title: Trouble with hyperref when resetting the counter for equations (specifically with the align environment)

text: I am trying to reset a counter to zero; however `hyperref` tries to reference previous equations. I am using:               \setcounter{equation}{0}      And if I have labels in say `align` environments:               \documentclass{article}     \usepackage{amsmath}     \usepackage{hyperref}     \begin{document}     \begin{align}     x=1     \label{eq:a} \\     y=2     \label{eq:b}     \end{align}     Eq.~\eqref{eq:a}.     Reset counter     \newpage     \setcounter{equation}{0}     \begin{align}     x=10     \label{eq:c} \\     y=20     \label{eq:d}      \end{align}     Now trying to refer to third equation Eq.~\eqref{eq:c}     \end{document}      If I now `\ref{eq:c}`, the `hyperref` package will point me back to `eq:a` (in text, they both have the same number). Is there a way to fix this without manually stepping a new counter you make? I.e. can you fix it without doing something like this:               \documentclass{article}     \usepackage{amsmath}     \usepackage{hyperref}     \begin{document}     \begin{align}     x=1     \label{eq:a} \\     y=2     \label{eq:b}     \end{align}     Eq.~\eqref{eq:a}.     Reset counter     \newpage     %% \setcounter{equation}{0}                                %Commented out line     \newcounter{newequation}                                   %Added line     \renewcommand{\theequation}{\arabic{newequation}}          %Added line     \stepcounter{newequation}                                  %Added line     \begin{align}     x=10     \label{eq:c} \\      \stepcounter{newequation}                                  %Added line     y=20     \label{eq:d}      \end{align}     Now trying to refer to third equation Eq.~\eqref{eq:c}     \end{document}      ?