title: How to show column names of table from text file on the top of every page?

text: I have a table stored in text file. I want to insert the table into LaTeX and keep the column names appearing on the top of every page. I tried the code as below, but it doesn't work. Could anybody give me some advice?               \usepackage{fancyvrb}     \begin{center}     \begin{longtable}{cccc}     1.id    2.Name   3.Age  4.gender\\[0.2cm]     \hline     \endhead % all the lines above this will be repeated on every page     \VerbatimInput[baselinestretch=1,fontsize=\\footnotesize]{myfile.txt}     \end{longtable}     \end{center}      `myfile.txt` is a 4-column table with hundreds of rows. Like               id      name              Age  gender     32432   Angela Cheung     34    F     23245   Katherine Zhang   25    F     254535  Tim Clark         42    M     2523    Richard Davis     44    M     435     Ed Pitt           23    M


title: How to put your symbol explanation for the formula?

text: I have a formula written in LaTeX. What is the best way to explain what the symbols mean in the formula? For example I have this equation with a where: symbol definitions               \begin{equation}     \sum_{i=0}^{n}\frac{\left(\omega_MM_i+\omega_PP_i+\omega_TT_i\right)\omega_i}{n}\\     \text{where}     \text{n = amount of weeks}     \text{M = Missed}     ...     \end{equation}      Any suggestions?


title: listings incorrectly highlights PHP keywords

text: I have definitions as below:               \lstset{         commentstyle = \color{gray},         extendedchars = \true,         inputencoding = utf8x,         language = php,         keepspaces = true,         keywordstyle = \bfseries     }      And here's the code:               \begin{lstlisting}[language=PHP]             function processRequest()             {                 $req = $this->request;                 $view = $this->view;                 $view->addHeaderScript("scripts/jquery_addons.js");                 // doing smth...                 return $this->view;             }      But only `if`, `else` and `foreach` keywords are highlighted. I want `function` and `return` keywords also to be highlighted.


title: biblatex style matching stock ACM style

text: Has anyone done a `biblatex` bibliography style that matches the stock `acm.bst` as far as formatting? I want `biblatex`'s more sophisticated handling of things like URLs, but the journal I'm submitting to specifies ACM- style formatting.


title: Glossary-like list of subsection headings

text: I have a document, that has same subsection headings on multiple pages. I would like to create something like a glossary, that prints the list of headings and references to the pages where the headings are. I can do this with `glossaries` package, but I have to define `\newglossaryentry` with empty description for each heading, which I would like to avoid (it is quite annoying for a lot of headings). Is there any better way to do this? (It doesn't have to use glossaries, I don't care...) This does basically what I want with glossaries, which seems overly complicated to me:               \documentclass{article}          \usepackage{lipsum}     \usepackage{hyperref}     \usepackage{glossaries}          \makeglossaries          \newglossaryentry{heading1}     {       name=heading1,       description={},     }     \newglossaryentry{heading2}     {       name=heading2,       description={},     }          \begin{document}     \printglossaries     \clearpage          \section{sth}     \subsection{\Gls{heading1}}     ...     \subsection{\Gls{heading2}}     \lipsum     \subsection{\Gls{heading2}}     \lipsum     \subsection{\Gls{heading1}}     ...          \end{document}


title: How can I get LaTeX to warn about unreferenced figures?

text: When writing documents, I consider it to be necessary that all figures and tables are referenced (`\ref`) in the text, whether or not I've remembered to `\label` them. LaTeX does not currently warn if a figure or table is not referenced. Is there a way to ensure that this is flagged up as a warning? Note that I am specifically concerned about figures and tables, not chapter or section headings; it will be no good looking just at `\label`s that don't have an associated `\ref`.


title: Footnotes not showing up (no tables involved here!)

text: I'm having a difficult time with footnotes because I'm trying to do a project report and some footnotes do show up, other don't. Here is a minimal document showing this behavior:               \documentclass[]{article}          \begin{document}          Working footnote\footnote{Footnote is present!}          \begin{description}          \item[Entrée vidéo ASI]     \emph{Asynchronous Serial Interface}~: interface de transmission très     similaire au SDI~: en effet, les mêmes composants sont utilisés. La     principale différence est que les données sont déjà compressées et     habituellement encapsulées dans un flux MPEG-TS\footnote{This footnote     shows up, perfect.}.          \item[Memoires DDR2\footnote{This note has disappeared!} SDRAM\footnote{So as this one!}] Ces mémoires volatiles perdent     leurs informations lorsqu'elles ne sont plus alimentées ni rafraîchies !          \item[Entrée vidéo ASI bis]     \emph{Asynchronous Serial Interface}~: interface de transmission très     similaire au SDI~: en effet, les mêmes composants sont utilisés. La     principale différence est que les données sont déjà compressées et     habituellement encapsulées dans un flux MPEG-TS\footnote{Again, this     one works perfectly!}.          \end{description}          \end{document}      I feel like I've tried everything but with no luck! I'm running Ubuntu 12.04 and the problem shows up with pdfLaTeX and XeLaTeX, whether I use the command line or TeXworks.


title: Get partly filled circle symbol scale linearly with parameter

text: I want to create a `\rating` command that draws a partly filled circle, according to a numeric parameter between 0 and 100: ![sequence of 10 circular rating symbols](http://i.stack.imgur.com/VjH9Q.png) **Question:** How can I modify the expression for determining the angles in `arc`, so that the filling rises more steadily over the whole value range? Right now, ratings from 0 to 20 look empty, 80 to 100 look completely filled and only in between there is a steady rise. **Clarification:** Rather than a mathematically rigoros expression, I am looking for the simplest expression that _looks right_ , i.e. that `\rating{25}`, `\rating{50}` and `\rating{75}` visually look like 1/4, 2/4 and 3/4.               \documentclass{minimal}     \usepackage{tikz}          \newcommand{\rating}[1]{     \begin{tikzpicture}     \fill[lightgray] ({270-1.8*#1}:1ex) arc ({270-1.8*#1}:{270+1.8*#1}:1ex) -- cycle;     \draw[black, thin, radius=1ex] (0,0) circle;     \end{tikzpicture}}          \begin{document}     This really should scale\dots     \rating{0} \rating{10} \rating{20} \rating{30} \rating{40} \rating{50}     \rating{50} \rating{60} \rating{70} \rating{80} \rating{90} \rating{100}     \dots linearly.     \end{document}


title: Equivalent of \chapter[title]{title} in ConTeXt

text: In LaTeX, one can use `\chapter[A]{B}`, such that, in the table of contents, "A" appears, but in the actual page where the chapter begins, "B" appears. This allows one to print different text in the table of contents. What is the equivalent of this in ConTeXt?


title: Postscript, EPS and PSTricks: what are the differences at this conditions?

text: The program that I use as an editor for vector based images is able to export using the following standards:   * Postscript 2 and 3 ( .ps )   * PSTricks macro written in Latex ( .tex )   * Eps ( .eps )   * SVG ( .svg ) Now after using latex for some time I can't really say which one is better for a latex based workflow, but I have been able to write down some requirements, I need support for :   * static images only ( no need for animations at this point, also my final goal is always a pdf anyway )   * inclusion from external file ( I often use relative paths to organize everything in their own directories )   * usable in styles `.sty` files   * lightweight and easy to render in the final pdf ( sometimes `latex` creates some really hard-to-render images )   * easy to avoid aliasing / not prone to poor rendering   * text as path or text as text ( be able to incorporate the text from the image as "normal" text or viceversa )   * a format that copes well with layouts properties like margins, the center of each element, scaling, etc etc . Since I'm not new to the imaging world and to the graphics world in general, I see Postscript as the old ancestor of pretty much anything that fits in a pipeline for the production of documents and vector images, I don't wanna sound like I have a biased opinion but probably PS works better for pdf production ? I don't know, I'm just thinking out loud. Anyway I'm more interested in the points I gave, especially the quality of the final product is everything to me. As a special note I would like to know if latex uses an internal representation of a given vector image and what language is used for that.


title: repetitive footnotes

text: Is it possible to have the footnotes not to repeat in the same page and take the old number? In other words, even if the footnote labels are same, can the footnotes have same number. here is my MWE.               \documentclass[a4paper,10pt]{book}        \usepackage[para]{footmisc}    % to have footnotes in a line     \begin{document}     This is my test document which has these four footnotes.      Footnote1\footnote{one},      footnote2\footnote{two},      footnote3\footnote{three}     and last footnote\footnote{one} to show that fourth one repeats.     \end{document}      The question is in the above example, i would like the last footnote to have 1 and not 4.


title: Appendix with mostly tables—problems with floats and longtable

text: I am sectioning my appendix with `\chapter` and `\section`, I sometimes have to add some text sections and then the following table is placed _after_ the next page. I don't know how to prevent these table placements. ![Problem 1](http://i.stack.imgur.com/grhWu.png) My second problem is that the appendix mostly consists only of long tables (`\longtable`), and when placing one longtable after another etc., blocks of rows are being shifted. I guess these are some float problems. See screenshot here: ![enter image description here](http://i.stack.imgur.com/OKwq6.png) I get the warning: > `Package longtable Warning: Column widths have changed (longtable) in table > 2 on input line 257.` When I remove the \chapter and \section sectioning, the table lining up well, however I need a structured appendix. What is happening there? **MWE**               \documentclass[BCOR=5mm,paper=letter,11pt,title page,oneside,headinclude, footinclude=true,abstractoff,headings=optiontohead,cleardoublepage=empty]{scrbook}     \usepackage{classicthesis} % nochapters          \usepackage{lipsum}               \usepackage{longtable}     \usepackage{booktabs}          \usepackage{lscape}          \begin{document}              \lipsum[3-6]              \appendix              \chapter{Data}         \section{A section}         \lipsum[3-8]              \begin{landscape}         \begin{center} %example from: http://users.sdsc.edu/~ssmallen/latex/longtable.html         \begin{longtable}{|l|l|l|}         \caption[Feasible triples for a highly variable Grid]{Feasible triples for          highly variable Grid, MLMMH.} \label{grid_mlmmh} \\              \hline \multicolumn{1}{|c|}{\textbf{Time (s)}} & \multicolumn{1}{c|}{\textbf{Triple chosen}} & \multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline          \endfirsthead              \multicolumn{3}{c}%         {{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\         \hline \multicolumn{1}{|c|}{\textbf{Time (s)}} &         \multicolumn{1}{c|}{\textbf{Triple chosen}} &         \multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline          \endhead              \hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline         \endfoot              \hline \hline         \endlastfoot              0 & (1, 11, 13725) & (1, 12, 10980), (1, 13, 8235), (2, 2, 0), (3, 1, 0) \\         2745 & (1, 12, 10980) & (1, 13, 8235), (2, 2, 0), (2, 3, 0), (3, 1, 0) \\         5490 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         8235 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         10980 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         13725 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         16470 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         19215 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         21960 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         24705 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         27450 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         30195 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\         32940 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         35685 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         38430 & (1, 13, 10980) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         41175 & (1, 12, 13725) & (1, 13, 10980), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         43920 & (1, 13, 10980) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         46665 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\         49410 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\         52155 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         54900 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         57645 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         60390 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         63135 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         65880 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         68625 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\         71370 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         74115 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         76860 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         79605 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         82350 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         85095 & (1, 12, 13725) & (1, 13, 10980), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         87840 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         90585 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         93330 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         96075 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         98820 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         101565 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         104310 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         107055 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         109800 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         112545 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         115290 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         118035 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         120780 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         123525 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         126270 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         129015 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\         131760 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\         134505 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         137250 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         139995 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\         142740 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\         145485 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         148230 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\         150975 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         153720 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         156465 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         159210 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         161955 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         164700 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\         \end{longtable}         \end{center}         \end{landscape}                        \end{document}


title: Runaway argument

text: Where is my fault here: `\text{Genom att undersöka var kurvan $f_{A}(x)$ skär linjen $T=20$ ser vi att $x\approx {4.3}$ då $f_{A}(x) = 20$`. Error message "Runaway argument".


title: Automatic line breaks of long numbers in listings

text: How can I automatically break long numbers in a listing? Redefining \lst@lettertrue doesn't work.               \documentclass{article}     \usepackage[T1]{fontenc}          \usepackage{listings}     \lstset{       breaklines=true     }     \makeatletter     \def\lst@lettertrue{\let\lst@ifletter\iffalse}     \makeatother          \begin{document}     \begin{lstlisting}       5646534535677654567453241456765467863576465467345675856382436457687534678665425769888843222222222587     \end{lstlisting}     \end{document}


title: surface integral

text: I can do a path integral like this:               $$\oint \limits_{C(S)} fd{\textbf l}$$      But how can I do a surface integral? The output should look something the surface integrals below, but hopefully better: ![enter image description here](http://i.stack.imgur.com/3HGeY.png)


title: minitoc customisation

text: I have the following in my minitoc:               1     One One     2     Two Two           2.1     Two Point One           2.2     Two Point two      I wonder if there is a way to reduce the space after the section and subsection numbers to have something like:               1  One One     2  Two Two        2.1  Two Point One        2.2  Two Point two      A MWE is as follows:               \documentclass{report}          \usepackage{minitoc}     \dominitoc          \begin{document}          \chapter{Chapter One}     \minitoc          \section{Section One One}     \subsection{Subsection One One One}     \subsection{Subsection One One Two}               \end{document}


title: apa6: Sidewaystable combined with threeparttable, endfloat problem

text: I am using the `apa6` class and want to place tables at the end of the manuscript. This works well with normal tables, and also with sidewystables. However, it does not work when a sidewaystable is combined with a threeparttable, as in the example of the apa6 class. Here's a MWE, where the table is positioned in the text, not at the end:               \documentclass[man,a4paper]{apa6}     \usepackage[american]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \usepackage{amsmath}    % for advanced math displays     \usepackage{rotating} % sidewaystable     % \DeclareDelayedFloatFlavor{sidewaystable}{table}               \title{Title}     \shorttitle{shorttitle}          \author{Batman}     \leftheader{Robin}     \affiliation{Batman Academy}     \date{February 20, 2013}               % Abstract: 250 words max, up to 5 keywords     \abstract{Abstract}     \keywords{}          \begin{document}         \maketitle  %First line of text directly after \maketitle (no blank line)     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \begin{sidewaystable}       \begin{threeparttable}         \caption{Sample ANOVA table}         \begin{tabular}{lllll}           \toprule             Stubhead & \( df \) & \( f \) & \( \eta \) & \( p \) \\           \midrule             & \multicolumn{4}{c}{Spanning text} \\             Row 1 & 1 & 0.67 & 0.55 & 0.41 \\             Row 2 & 2 & 0.02 & 0.01 & 0.39 \\             Row 3 & 3 & 0.15 & 0.33 & 0.34 \\             Row 4 & 4 & 1.00 & 0.76 & 0.54 \\           \midrule         \end{tabular}         \begin{tablenotes}           \small           \item This is where authors provide additional information about           the data, including whatever notes are needed.         \end{tablenotes}       \end{threeparttable}     \end{sidewaystable}          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.               \section{Method}          \section{Results}          \section{Discussion}          \end{document}      To summarize, `table` + `threeparttable` works, `sidewaystable` alone works, but `sidewaystable` + `threeparttable` does not work. The solution proposed here, gives an error:               \usepackage{rotating} % sidewaystable     \DeclareDelayedFloatFlavor{sidewaystable}{table}          Latex Error: ./Tabletest.tex:8 Undefined control sequence.


title: Undefined control sequence

text: On this code:               $t = \plusminus \sqrt{\frac{2,7}{4,9}} \approx \plusminus 0,74$      I get the message `Undefined control sequence`. What have I forgotten?


title: Dificult using LTXtable

text: I have a script in R that build a report in LaTeX. Sometimes, this report has very long and very wide table, so, after some research I decided try `ltxtable`. My problem is that I didn't get how it works. I have this LaTeX code for the report:               \documentclass{report}     \usepackage{ltxtable, tabularx, longtable}     \usepackage[latin1]{inputenc}     \usepackage[left=2cm,top=1cm,right=3cm,nohead,nofoot]{geometry}     \title{CP 68 - Estatístico}     \author{Rodrigo Coster - 1141783-01}     \begin{document}     \textbf{ \begin{center}{\LARGE Informações referentes ao CP 68 - Estatístico }\end{center} }      \section*{Informações sobre processos}       Relação do quantitativo de candidatos convocados para cada processo selecionado       \LTXtable{\textwidth}{'table.tex'}     \section*{Informações sobre fila de espera}       Este CP não possui mais candidatos habilitados.       \end{document}      And, in the same folder, the file `table.tex`:               \begin{longtable}{|c|c|c|c|c{1cm}|}     \begin{center}      \hline        \textbf{\textbf{Processo}} & \textbf{Vagas} & \textbf{Data} & \textbf{Convocados} & \textbf{Exercicio ok} \\ \hline        \textbf{001.010726.12.8} & 2 & 13/04/2012 & 2 & 2 \\ \hline       \end{center}     \end{longtable}      After run, in console appears:               ("C:\relatorios\Concursos\20130312 - CP 68 - Estatistico.aux")     *geometry* driver: auto-detecting     *geometry* detected driver: pdftex     Enter file name:      I tried a lot of file names. For most of them, he ask for the name again. If I type `table.tex` I get this error:               (C:\relatorios\Concursos\table.tex     ! Missing # inserted in alignment preamble.     <to be read again>                         &     l.1 \begin{longtable}{|c|c|c|c|c{1cm}|}          ?       I already tried put `\begin{center}` in the first line, but didn't work. EDIT: Anothe `table.tex`:               \begin{longtable}{|c|c|c|c|c|c|}      \hline        \textbf{\textbf{Área}} & \textbf{Convocados} & \textbf{Não ingressou} & \textbf{Para convocar} & \textbf{Manifestou interesse} & \textbf{Exercicio ok} \\ \hline        \textbf{Administração e economia               } &   8 &  6 & 0 &  0 &   2 \\ \hline        \textbf{Anos iniciais dos ciclos de formação   } & 474 & 80 & 0 & 13 & 381 \\ \hline        \textbf{Artes visuais                          } &  45 &  8 & 2 &  2 &  33 \\ \hline        \textbf{Biologia                               } &   1 &  0 & 0 &  0 &   1 \\ \hline        \textbf{Ciências da computação                 } &   2 &  1 & 0 &  0 &   1 \\ \hline        \textbf{Ciências físicas, químicas e biológicas} &  72 & 12 & 0 &  1 &  59 \\ \hline        \textbf{Ciências sócio-históricas              } &  48 & 11 & 0 &  2 &  35 \\ \hline        \textbf{Dança                                  } &  17 &  6 & 0 &  0 &  11 \\ \hline        \textbf{Deficiência mental                     } &  40 &  5 & 0 &  0 &  35 \\ \hline        \textbf{Deficiência visual                     } &   4 &  1 & 0 &  0 &   3 \\ \hline        \textbf{Educação de surdos                     } &   6 &  3 & 0 &  0 &   3 \\ \hline        \textbf{Educação física/rede escolar           } & 134 & 26 & 0 &  1 & 107 \\ \hline        \textbf{Educação infantil                      } & 123 & 17 & 1 &  2 & 103 \\ \hline        \textbf{Filosofia                              } &   7 &  0 & 0 &  0 &   7 \\ \hline        \textbf{Física                                 } &   1 &  0 & 0 &  0 &   1 \\ \hline        \textbf{Geografia                              } &  56 & 15 & 1 &  2 &  38 \\ \hline        \textbf{História                               } &  51 & 15 & 0 &  0 &  36 \\ \hline        \textbf{Língua espanhola                       } &  33 &  8 & 0 &  1 &  24 \\ \hline        \textbf{Língua francesa                        } &   3 &  1 & 0 &  0 &   2 \\ \hline        \textbf{Língua inglesa                         } &  38 &  9 & 1 &  0 &  28 \\ \hline        \textbf{Língua portuguesa                      } &  81 & 22 & 1 &  0 &  58 \\ \hline        \textbf{Matemática                             } & 104 & 26 & 1 &  1 &  76 \\ \hline        \textbf{Música                                 } &  51 & 17 & 0 &  1 &  33 \\ \hline        \textbf{Teatro                                 } &   5 &  0 & 0 &  0 &   5 \\ \hline       \end{longtable}


title: Stacked chart in TeX (added up line loads)

text: I've got a problem with finding the correct way or commands to make a nice plot in TeX, even with some basic experience in pgf/TikZ. Imagine a weight distribution with start- and stop values and a line load, given in CSV-data with about 150 rows. For example something like this:               x-start [m] | x-stop [m] | weight [t/m]       -3;   5; 2.5       2;   4 ; 5.6       2.45;  6.33 ; 0.25       -1; 2.3; 4       4; 5 ; 7.8      I would like to generate a plot with the added up weight over x. As you might see, it is difficult to deal with the loads given as extensions, overlapping areas and having no discrete points. I would be very glad, if you have some ideas for solving this problem or giving some hints! At the moment I'm thinking of evaluating weights at discrete points, adding them up, but I think there is a more correct and satisfying way :-)


title: Insert hyphenation point in BibTeX using PDFLaTeX and hyperref

text: How to tell PDFLaTeX to make hyphenation in place where I want it to be? I have my document file:               \documentclass[10pt,a4paper]{article}          \PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}     \usepackage[margin=2.5cm]{geometry}          \begin{document}          This is text with \cite{reference}.          \bibliographystyle{unsrt}     \bibliography{bib_file}          \end{document}      and `bib_file.bib` file:               @misc{reference,         title = {{Some dummy title in bib.}},         howpublished = {\url{http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html\#concurrency}},         note = {Last access: 12.03.2013},     }      After building that file, the new line is places just after '.':               1st line: Some dummy title in bib. http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.     2nd line: html#concurrency. Last access: 12.03.2013.      But I wanted to insert hyphenation point on other place, like:               1st line: Some dummy title in bib. http://docs.oracle.com/javase/1.5.0/docs/     2nd line: relnotes/features.html#concurrency. Last access: 12.03.2013.      or even:               1st line: Some dummy title in bib. http://docs.oracle.com/javase/1.5.0/docs/ <-/     2nd line: relnotes/features.html#concurrency. Last access: 12.03.2013.      `<-/` - is the _enter_ arrow. I tried to insert `{\\-}` and `\\-` into the url, but it adds in that place `\discretionary{- }{}{}` text


title: Want to run graph on Beamer class

text: Before this, I run the program code about a graph in \documentclass{article}and it succeed. But, when I change it to \documentclass{beamer} and add \begin{frame} ...content... \end{frame} in the writing, the problem come. Any one know how to solve this problem. Here is my code of graph:                  \documentclass{beamer}        \usepackage[margin=0.5in]{geometry}        \usepackage[utf8]{inputenc}        \usepackage{textcomp}             \usepackage{pgfplots}        \pgfplotsset{width=10cm,compat=1.9}             \begin{document}            \begin{frame}             \begin{tikzpicture}        \begin{axis}[         title={},         xlabel={Shape parameter},         ylabel={Confidence Interval for location parameter},         xmin=-3.5, xmax=1.5,         ymin=0, ymax=10.5,         xtick={-3,-2,-1,0,1},         ytick={4,6,8,10},         legend pos=north west,         ymajorgrids=true,         grid style=dashed,          ]              \addplot [          color=red,          ]          coordinates {(-3,9.079491)(-2.5,9.452603)(-2,9.777221)(-1.9,9.766175)                              (-1.8,9.919383)(-1.7,9.968541)(-1.6,10.033590)(-1.5,10.091473)(-1.4,10.058541)                       (-1.3,10.227247)(-1.2,10.16644)(-1.1,10.229299)(-1.0,10.192760)(-0.9,10.192760)                       (-0.8,10.241929)(-0.7,10.216065)(-0.6,10.227887)(-0.5,10.186640)(-0.4,10.169810)             (-0.3,10.258170)(-0.2,10.250998)(-0.1,10.19826)(0.2,10.209682)(0.4,10.193243)            (0.6,10.205120)(0.8,10.184040)(1.0,10.247810)};              \addplot[         color=blue,          ]          coordinates{(-3,2.859848)(-2.5,6.456956)(-2.0,7.751660)(-1.9,8.111291)                    (-1.8,8.394369)(-1.7,8.534462)(-1.6,8.775830)(-1.5,9.011516)(-1.4,9.098876)           (-1.3,9.286731)                 (-1.2,9.257532)(-1.1,9.407769)(-1.0,9.688250)(-0.9,9.735059)(-0.8,9.814046)                 (-0.7,9.780176)(-0.6,9.814046)(-0.5,9.800660)(-0.4,9.768130)(-0.3,9.818090)          (-0.2,9.831134)(-0.1,9.772771)  (0.2,9.772683)(0.4,9.795465)(0.6,9.745820)          (0.8,9.830740)(1.0,9.819173)};                   \end{axis}         \end{tikzpicture}              \end{frame}


title: Sloppy \left and \right?

text: The `\left` and `\right` commands often produce improvidently large delimiters. It almost always looks better to use delimiters that are just slightly too small than delimiters that are too large. With computer modern, the results are usually bearable, but with (for example) the `mathdesign` package using charter font, the delimiter sizing is intolerable. For instance, the following code produces vertical bars around y that are much larger than x:               \documentclass{amsart}     \usepackage[charter]{mathdesign}          \begin{document}              It would be nice if these were the same size:         \[ \left|x\right| \quad \left|y\right| \]         It would be even better if         \[\left|x^{2^3}\right| \quad \text{ looked like } \quad \bigl| x^{2^3}\bigr|\]          \end{document}      An image of the result: ![enter image description here](http://i.stack.imgur.com/q1tja.png) So now the question: Any ideas on how to produce sloppy `\left` and `\right` commands (say, `\sleft` and `\sright`) that allows a little bit of overhang?


title: Why do I have to place % at the end of line preceding \pstVerb?

text: Please consider the position of the red dots. ![enter image description here](http://i.stack.imgur.com/WC9fQ.png) ## First Case When I don't activate `\pstVerb{/xxx 1 def}`, the red dot is properly positioned.               \documentclass[border=12pt]{standalone}     \usepackage{pst-eucl}     \addtopsstyle{gridstyle}{gridlabels=0,griddots=0}          \begin{document}     \begin{pspicture}[showgrid](2,2)         \pstGeonode{A}(1.5,0){B}(1.5,1.5){C}         \pstRightAngle[fillstyle=solid,fillcolor=green!50]{A}{B}{C}         %\pstVerb{/xxx 1 def}         \psdots[linecolor=red](1,1)     \end{pspicture}         \end{document}      ## Second Case When I activate `\pstVerb{/xxx 1 def}`, the red dot is displaced from its correct position.               \documentclass[border=12pt]{standalone}     \usepackage{pst-eucl}     \addtopsstyle{gridstyle}{gridlabels=0,griddots=0}          \begin{document}     \begin{pspicture}[showgrid](2,2)         \pstGeonode{A}(1.5,0){B}(1.5,1.5){C}         \pstRightAngle[fillstyle=solid,fillcolor=green!50]{A}{B}{C}         \pstVerb{/xxx 1 def}         \psdots[linecolor=red](1,1)     \end{pspicture}     \end{document}      ## Third Case When I append `%` at the end of `\pstRightAngle[fillstyle=solid,fillcolor=green!50]{A}{B}{C}`, the red dot returns to its proper position.               \documentclass[border=12pt]{standalone}     \usepackage{pst-eucl}     \addtopsstyle{gridstyle}{gridlabels=0,griddots=0}          \begin{document}         \begin{pspicture}[showgrid](2,2)         \pstGeonode{A}(1.5,0){B}(1.5,1.5){C}         \pstRightAngle[fillstyle=solid,fillcolor=green!50]{A}{B}{C}%<== why do I need this comment?         \pstVerb{/xxx 1 def}         \psdots[linecolor=red](1,1)     \end{pspicture}     \end{document}      ## The question: Why do I need to put `%` at the end of `\pstRightAngle[fillstyle=solid,fillcolor=green!50]{A}{B}{C}` rather than at the end of `\pstVerb{/xxx 1 def}`? It is really confusing.


title: Don't skip framenumbers in beamer in handout mode

text: Consider the following beamer example below. Is it possible to adjust this, that Frame 4 has framenumber 3 on the handout (and not 4 in my example). In other words the numbering in the handout should be as the code of frame 3 would be commented out (and not just have the option ).               \documentclass[handout,gray]{beamer}     \usepackage[utf8]{inputenc}          \usepackage{pgfpages}     \pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm,landscape]          \setbeamertemplate{headline}{\scriptsize{\vspace*{0.3cm}\hspace*{0.3cm}\insertframenumber}}               \begin{document}               \begin{frame}        \frametitle{Frame 1}        Frame 1     \end{frame}          \begin{frame}<display:0>        \frametitle{Frame 2}        Frame 2     \end{frame}          \begin{frame}<handout:0>        \frametitle{Frame 3}        Frame 3     \end{frame}          \begin{frame}        \frametitle{Frame 4}        Frame 4     \end{frame}        \end{document}      ![Frames](http://i.stack.imgur.com/CTKHm.png)


title: Which packages/practices are relevant for writing Structured Derivations? (similar to Dijkstra's calculational style of proofs)

text: Does anyone know of any packages that support this style of writing proofs? ![A non-trivial example of "Structured Derivation" syntax, taken as a screenshot from Ralph-Johan Back's paper](http://i.stack.imgur.com/ISRtR.png) The only things that I've found are: tex-ewd, a bunch of plain TeX macros on CTAN written specifically with Dijkstra in mind; and a Windows-only version of LyX that's been extended with support with structured derivations. (It's too bad that the LyX-SD is limited to Windows, because I'd guess that writing proofs in LyX would be wonderful) In the case that there's nothing out there and that I have to roll my own, are there any packages that are similar enough that I could learn the "right way" to go about making a Structured Derivations package for LaTeX? And I offer a pre-emptive "thank you" :) I'll be really grateful for any help. If you need more information to be helpful (or even if I've just piqued your interest) here are some good resources:   * the Wikipedia page   * A sort of home page for an associated project.   * A Powerpoint presentation with lots of examples. And colors! http://www.risc.jku.at/conferences/cadgme2009/Back/TeachingMathLinzShort.pdf   * The paper containing the details and formal grammar. The example that I attached to this question is a screenshot from this paper. http://www.tara.tcd.ie/bitstream/2262/41529/1/PEER_stage2_10.1007%252Fs00165-009-0136-5.pdf


title: How to fix the pdf "Bad 'Length' attribute in stream" issue using MacTex tools?

text: Scenario: I am generating pdf using FPDI from php , where I use a template pdf to fill the form (its static not Fillable) ,I place text in required positions to give the feeling of its filled by user. which is working great except size it little extra than expected and pdf are viewable without any error or issues New Requirement: Now I need to   * merge these files into single file   * create a bookmark to each report generated in first step (create TOC)   * possibility reset the page numbers  Obviously I need an open source tool , I don't find any opensource lib/tool( php /java/commandline ), so I installed MacTex package for pdflatex and realted tool Whenever I include the pdf generated from php I get the errors below . My question to this great community is how I can fix this issue and what are the chances of merging the pdf files generated from php and add TOC I have borrowed the tex file from SE by @captaincomic **Tex**               \documentclass[8pt]{article}     \usepackage[final]{pdfpages}     \usepackage{fancyhdr}          \topmargin 70pt     \oddsidemargin 150pt          \pagestyle{fancy}     \rfoot{\Large\thepage}     \cfoot{}     \renewcommand {\headrulewidth}{0pt}     \renewcommand {\footrulewidth}{0pt}          \begin{document}     \includepdfset{pagecommand=\thispagestyle{fancy}}     \includepdf[pages=-]{include_file.pdf}     \end{document}      **> pdflatex number.tex** **Output Error**                 ....         <include_file.pdf, id=3, page=1, 614.295pt x 794.97pt>         <use include_file.pdf, page 1> <use include_file.pdf, page 1>         <use include_file.pdf, page 1> <use include_file.pdf, page 1>         <use include_file.pdf, page 1> [1{/usr/local/texlive/2011/texmf-var/fonts/map/p         dftex/updmap/pdftex.map} <./include_file.pdfError (2874915): Bad 'Length' attribute in stream              !pdfTeX error: pdflatex (file ./include_file.pdf): PDF inclusion: type <error>          cannot be copied          ==> Fatal error occurred, no output PDF file produced!      PDF file


title: Fatal error occurred, no output PDF file produced in php file

text: We are using following code in `.php` script for generate `.pdf` file.               $result1 = exec("R CMD Sweave /var/www/html/r/r_latex_sweave.Rnw");          $result2 = exec("pdflatex /var/www/html/r/r_latex_sweave.tex");      but, we are getting this errors when we are executing `.Rnw` and `.tex` files. **! I can't write on file `r_latex_sweave.log'. Please type another transcript file name: ! Emergency stop ! ==> Fatal error occurred, no output PDF file produced!** Note: We have `.tex` and `.Rnw` folder in `/var/www/html` folder?


title: XeTeX: Line numbering in a book with Devanagari and polyglossia

text: I am typesetting a book in XeLaTeX with both Samskrita in Devanagari script and English. I am trying to include line numbers for proofreading purposes. I want to use the **lineno** package which works on my system for the following MWE -               \documentclass{book}     \usepackage{lineno}     \usepackage{lipsum}     \begin{document}     \linenumbers     \chapter[One]{One}     \section[One]{One}     \lipsum[1-5]     \end{document}      I tried using the package in a document with both Devanagari and English as follows               \documentclass{book}     \renewcommand{\chaptername}{अध्यायः}     \usepackage{lineno}     \usepackage{polyglossia}     \usepackage{lipsum}     \setmainlanguage{sanskrit}     \setotherlanguage{english}     \setmainfont[Script=Devanagari]{Arial Unicode MS}     \newfontfamily\devanagarifont[Script=Devanagari]{Arial Unicode MS}     \newfontfamily{\englishfont}{Times New Roman}     \newcommand{\devanagarinumeral}[1]{%        \devanagaridigits{\number\csname c@#1\endcsname}}     \begin{document}     %The following line causes xetex to fail     \linenumbers     \renewcommand{\thechapter}{\devanagarinumeral{chapter}}     \renewcommand{\thesection}{\devanagarinumeral{section}}     \renewcommand{\thepage}{\devanagarinumeral{page}}     \chapter[प्रथमोऽध्यायः]{प्रथमोऽध्यायः}     \section[प्रथमः पादः]{प्रथमः पादः}     \begin{english}     \lipsum[1-5]     \end{english}     \begin{sloppypar}\hyphenrules{nohyphenation}     वेदो वै विगलित\-विभेदो विखात\-खेदो विच्छिन्न\-दोषच्छेदो      निरस्ताशेष\-भ्रम\-प्रमाद\-विप्रलिप्सा\-करणापाटवादि\-पुंदोष\-शङ्का\-पङ्क\-कलङ्कावकाशो      ...\end{sloppypar}     \end{document}      When I run XeLaTex for the above, I get the following error               ! Package polyglossia Error:      The current roman font does not contain the Devanagari script!     Please define \devanagarifont with \newfontfamily.      Any pointers? How can I use **lineno** with Devanagari books? **EDIT** : The comment by cfr below helped. I added the following line in the preamble and now it works -               \renewcommand\linenumberfont{\normalfont\bfseries\small}      Please consider this solved.


title: IEEE template and caption=false option for subcaption package?

text: According to the IEEE transactions information (tar file here contains IEEEtran_HOWTO.pdf along with the class files) > Axel Sommerfeldt’s modern and actively maintained subcaption.sty package > [23] can not be recommended at this time because it does not provide an > option to prevent the underlying caption.sty from taking control of main > caption formatting away from IEEEtran. Instead they recommend using subfig invoked like this `\usepackage[caption=false]{subfig}` Are there any plans to add a `caption=false` flag to `subcaption`? It seems that `subfig` has not been touched since 2005, so I would rather stick with `subcaption` if possible. EDIT: There is a workaround posted here, but it involves re-defining how captions should be formatted, which seems to partially defeat the purpose of using a supplied style file.


title: Is there other possible way for continuous numbering?

text: I am creating a document using exam class. I have four question types here which i had created each a command. Is there facility to enforce continuous numbering for each question types instead of using the `\begin{questions}` ended with `\end{questions}`. ## example:               I. True or False Question type      1. ____ text text text text text text.      2. ____ text text text text text text.      3. ____ text text text text text text.          II. Enumeration      4. Elements of  nature      5. text text text text text text.      6. text text text text text text.      The sequence of the number in Part I is continued in the Part II. How can I make something like this one?


title: OS X command-script to compile LaTeX

text: I'm trying to create a script that compiles LaTeX on OS X. Unfortunately I'm not familiar with the language and even though the code works, it has several flaws. Is it possible to close the terminal without having to kill it (and every other instance of it)? Can it be improved easily to automatically find and compile all .tex-files in the folder?               #!/bin/bash     STR="document"     BASEDIR="$( dirname "$0" )"     cd "$BASEDIR"     pdflatex $STR.tex     bibtex $STR.aux     pdflatex $STR.tex     pdflatex $STR.tex          rm $STR.ilg     rm $STR.toc     rm $STR.aux     rm $STR.out     open $STR.pdf     killall Terminal


title: What is wrong about this arxiv latex bundle submission ? Please help I am out of mind?

text: I am trying to submit a article to arxiv that is perfectly compiled on texmaker but not in arxiv. There are many warnings around but no error at all. What might be the problem, if you dare to look all the lines linked below. https://www.evernote.com/shard/s146/sh/72b67292-b95e-4ed1-b27c-714fd1c39509/558fcb77e3fe50185fe38abe1008be8e Any suggestion is really welcome!


title: How to make sideways table with horizontal text in a cell?

text: I need to make such table in LaTeX: ![enter image description here](http://i.stack.imgur.com/Jcu9o.png) I came up only with this:               \documentclass{article}     \usepackage{graphicx}          \begin{document}          \begin{table}     \rotatebox{270}{             \begin{tabular}{|c|c|} \hline                 First First & First Second\\ \hline                 Second First & Second Second  \\ \hline             \end{tabular}         }          \caption{Table 1}         \label{table1}     \end{table}          \end{document}      But still don't know how to rotate the caption and how to add the cell with the horizontal text ("Existing solutions" cell). EDIT: I "almost" managed to do this, but still need the "existing solutions" cell. Any ideas? Heres the code:               \begin{sidewaystable}[ht]       \centering        \begin{tabular}{|c|c|c|c|c|c|c|c|c|} \cline{2-9}         \multicolumn{1}{c|}{} & \multicolumn{8}{c|}{\textbf{Features}} \\  \cline{2-9}         \multicolumn{1}{c|}{} & \textbf{\shortstack{}} & \textbf{\shortstack{}} & \textbf{\shortstack{}} &  \textbf{\shortstack{}} &  \textbf{\shortstack{}} & \textbf{\shortstack{}} &  \textbf{\shortstack{}} &  \textbf{\shortstack{}} \\         \hline \shortstack{} &  &  & \shortstack{} & \shortstack{} &  &  & \shortstack{} &  \\          \hline [25] & & & & & &  & & \\          \hline [26] & & & & & &  & & \\          \hline [27] & & & & & &  & & \\          \hline [28] & & & & & &  & & \\          \hline [29] & & & & & &  & & \\          \hline [30] & & & & & &  & & \\          \hline [31] & & & & & &  & & \\          \hline [32] & & & & & &  & & \\ \hline       \end{tabular}       \caption{My caption}     \end{sidewaystable}      And it looks like this right now: ![enter image description here](http://i.stack.imgur.com/Duoyt.png)


title: Applying condition around \intertext and \shortintertext leaves excess vertical space

text: When I try to make either `\intertext` or `\shortintertext` conditional I get excess vertical spacing prior to the conditional text as per the MWE below. Note the excess vertical spacing prior to _"Albert insisted that"_ and _"but we know"_. The `minipage` on the right represents the correct spacing as it does not have the `\ConditionalText{}` macro applied. ![enter image description here](http://i.stack.imgur.com/Wccsh.png) However, when the conditional is disabled, via the `\toggletrue{}`, the text is suppressed and the spacing is fine: ![enter image description here](http://i.stack.imgur.com/rIHOh.png) ## Notes:   * It seems that with              \NewDocumentCommand{\ConditionalText}{O{red} +m}{#2}%      the spacing problem is still there. However, the problem is resolved if I use the `\iftoggle` directly within the `align` environment as:              \newcommand{\TextWithConditional}{%         \hfill\textbf{Intertext with Conditionals}\hfill%         Newton said:         \begin{align*}             F &= ma \\             \iftoggle{SupressConditionalText}{}{\intertext{Albert insisted that}}             E &=mc^2 \\             \iftoggle{SupressConditionalText}{}{\shortintertext{but we know}}             E &=\frac{1}{2}mv^2         \end{align*}         Text after a conditional display math formula.%     }%      ## Failed Solution:   * Well, I had what I thought was a brilliant fix, but it seems that all I can do is to quote Edison and say "I have discovered a method that does _not_ work". Not sure why it does not work though.              \NewDocumentCommand{\ConditionalText}{O{red} +m}{%         \ignorespaces%         \iftoggle{SupressConditionalText}{}{%             \ifmmode%                 \let\OldIntertext\intertext%                 \let\OldShortIntertext\shortintertext%                 \def\intertext{\vspace*{\baselineskip}\OldIntertext}%                 \def\shortintertext{\vspace*{-\baselineskip}\OldShortIntertext}%                             #2% Don't underline if in math mode             \else%                 %\UnderlineText[#1]{#2}% This case not used in this MWE.             \fi%         }%         \ignorespacesafterend%     }%      * * * ## Code:               \documentclass{article}     \usepackage{xparse}% Not essential for this problem.     \usepackage{xcolor}     \usepackage{etoolbox}     \usepackage{mathtools}     \usepackage{soul}     \usepackage{parskip}% Eliminate need for \noindent     %\usepackage{showframe}          \newtoggle{SupressConditionalText}%          \togglefalse{SupressConditionalText}% This has too much space BEFORE the conditional \intertext.               \NewDocumentCommand{\UnderlineText}{O{red} +m}{%         \setulcolor{#1}\ul{#2}%     }%          \NewDocumentCommand{\ConditionalText}{O{red} +m}{%         \ignorespaces%         \iftoggle{SupressConditionalText}{}{%             \ifmmode%                 #2% Don't underline if in math mode             \else%                 \UnderlineText[#1]{#2}%             \fi%         }%         \ignorespacesafterend%     }%          \newcommand{\TextWithConditional}{%         \hfill\textbf{Intertext with Conditionals}\hfill%         Newton \ConditionalText{often} said:         \begin{align*}             F &= ma \\             \intertext{Albert \ConditionalText{awkwardly} insisted that}             E &=mc^2 \\             \ConditionalText{\shortintertext{but we know}}             E &=\frac{1}{2}mv^2 \\             \ConditionalText{\intertext{But, equating the two we obtain.}}                 mc^2 &= \frac{1}{2}mv^2             \shortintertext{from which \ConditionalText{we obtain}}             v &= \sqrt{2}c         \end{align*}         Text after a conditional display math formula.%     }%               \newcommand{\TextWithoutConditional}{%         \hfill\textbf{Intertext without Conditionals}\hfill%         Newton said:         \begin{align*}             F &= ma \\             \intertext{Albert awkwardly insisted that}             E &=mc^2 \\             \shortintertext{but we know}             E &=\frac{1}{2}mv^2         \end{align*}         Text after a conditional display math formula.%     }%     \newcommand{\TextWithoutConditionalWithoutInterText}{%         \hfill\textbf{No Intertext, No Conditionals}\hfill%         Newton said:         \begin{align*}             F &= ma \\             E &=mc^2 \\             E &=\frac{1}{2}mv^2         \end{align*}         Text after a conditional display math formula.%     }%          \begin{document}     \begin{minipage}[t]{0.45\linewidth}         \TextWithConditional     \end{minipage}     \hfill\vrule\hfill%      \begin{minipage}[t]{0.45\linewidth}         \TextWithoutConditional     \end{minipage}          \bigskip\hrule     \toggletrue{SupressConditionalText}%  Disable conditional text     %     With conditional text supressed, things work fine:          \begin{minipage}[t]{0.45\linewidth}         \TextWithConditional     \end{minipage}%     \hfill\vrule\hfill%      \begin{minipage}[t]{0.45\linewidth}         \TextWithoutConditionalWithoutInterText     \end{minipage}%     \end{document}


title: numberstringnum or numberstring in lowercase

text: I have tried a lot to use the `\numberstringnum` and `\numberstring` macros but it appears incomplete or even do not appear on the text. So I tested in the female version, like below:               \numberstringnum{\stotal{croquis}}[f]      and it's ok, but if I delete [f] or try another gender [m], or [n] the error persists. How can I use this function in lowercase?? The function `\Numberstringnum` or `\Numberstring` works great, but I cannot transform it to lowercase like `\lowercase\Numberstringnum f`. How can I make it? Here is my code:               \documentclass[a4paper,12pt]{article}          \usepackage[utf8]{inputenc}     \usepackage[portuguese]{babel}     \usepackage[T1]{fontenc}          \usepackage{fmtcount}               \begin{document}          \Numberstring{page}[f]      \Numberstringnum{1}[f]      \Numberstringnum{2}[f]      \Numberstringnum{3}[f]      \Numberstringnum{4}[f]           \numberstring{page}[f]      \numberstringnum{1}[f]      \numberstringnum{2}[f]      \numberstringnum{3}[f]      \numberstringnum{4}[f]           \Numberstring{page}[m]      \Numberstringnum{1}[m]      \Numberstringnum{2}[m]      \Numberstringnum{3}[m]      \Numberstringnum{4}[m]           \numberstring{page}[m]      \numberstringnum{1}[m]      \numberstringnum{2}[m]      \numberstringnum{3}[m]      \numberstringnum{4}[m]           \end{document}      And the anwer:               Uma Uma Duas Três Quatro     uma uma duas três quatro     Um Um Dois Três Quatro      The error:               Error in main.tex (line 30): Argument of \@unitstring has an extra }.     <inserted text>                      \par      l.30 \numberstring{page}[m]          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.      I think the problem is about the language - portuguese, I tested english and french and it's ok, but portugueses I get this error for lowercase, and \lowercase{\Numberstring{}} have no effect.


title: How to put directly figures and tables into the description key of the glossaries package?

text: I'm preparing a document class using the glossaries package to typeset dictionaries. Since many of my entries need figures, tables, and maybe, say, some C++ code, I'd like to know **is there a way to put directly these stuff into the description key of the glossaries package?**   Here is a simple MWE:               \documentclass[twoside]{book}     \usepackage[]{graphicx}      \usepackage{lipsum}     \usepackage[xindy,nonumberlist]{glossaries}     \makeglossaries          \newcommand{\dict}[4][]{%       \newglossaryentry{#2}%       {%         name=#2,%         symbol=#3,%         description=#4,%         #1%       }%       \glsadd{#2}%     }          \begin{document}         \dict{zero}{n}{\lipsum[4]}         \dict{adhesive}{n}{\lipsum[5]}         \dict{main}{n}{\lipsum[3]}         \dict{material}{n}{\lipsum[1]}     \printglossary     \end{document}      I know that one solution is storing those stuff in a command and then use it as the description, but I don't like this solution. My descriptions are like the below structure:                   \dict{lion}{n}{%         Lions live in ...              \begin{center}         \includegraphics[width=3cm]{lion}         \end{center}              They generally eat ...         }      BTW, I must only use `xindy` to sort the entries.


title: How can I adjust the total page count variable?

text: If I have a page count of 7, but the last page is a grading sheet (using the exam class). I do not actually want it to be counted as part of the exam, although I need one copy per printout. The variable `\numpages`contains the number 7, but I want to make it 6, such that the students read Side 1 of 6 etc. in the footer. Is there a way to make a formula that does something like: `\renewcommand{\numpages}{\numpages - 1}` ? Most questions involving page numbers seem to simply reset the counter after a few pages (using `\setcounter{page}{1}`), such that there is a new page one. In this case, that would not work.


title: Exclude line numbers from margin width

text: I am using the lineno package to add linenumbers on my twosided document. However, I have a restriction to leave a margin of 2.5cm inner and 4cm outer margin. This has to be completely free space. But the line numbers of the lineno package are being added into both those margins.   1. Can I somehow specify that the linenumbers are added to the document body instead of the margin?   2. If not, how do I set the margin of the document so that the correct amount of space is free of content? I thought about just adding the line number width to the margin, but because the line numbers are always on the left margin on even and odd pages, I would have to alternate this additional margin for my twosided document. Here is a minimal example:               \documentclass[12pt,twoside,ngerman]{report}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[a4paper]{geometry}     \geometry{verbose,         tmargin=2.5cm,         bmargin=2.5cm,         lmargin=4cm,         rmargin=2.5cm,         nomarginpar,         showframe}     \usepackage{fancyhdr}     \pagestyle{fancy}          \usepackage{lineno}     \usepackage{lipsum}          \renewcommand{\linenumberfont}{\footnotesize}          \begin{document}          \linenumbers     \lipsum          \end{document}      This screenshot illustrates my problem: ![margins](http://i.stack.imgur.com/SPfJu.jpg) The orange line shows how far the 4cm / 2.5cm go, the blue line shows how they should actually be. The line numbers should be further to the right.


title: Strange arrow mark with TikZ edge and anchors.

text: When I draw an edge between two nodes with anchors and globally set option `[->]`, I get an additional arrow tip symbol at the beginning of the last edge in the path. For example in               \documentclass{article}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}         \node (A) at (0,0) {$A$};         \node (B) at (1,0) {$B$};              \draw[->] (A.north east) edge (B.north west);              \draw (A.south east) edge[->] (B.south west);     \end{tikzpicture}     \end{document}      the first `\draw` command produces incorrect output, while the second produces correct output: ![result](http://i.stack.imgur.com/fUedo.png) Am I doing something wrong, or is this a bug in TikZ?


title: tikz bug in the automata package?

text: > **Possible Duplicate:**   >  Strange arrow mark with TikZ edge and anchors. The following code               \begin{tikzpicture}         \node (q0) [initial,state] {$q_0$};         \node (q1) [state,right of=q0,accepting]    {$q_1$};         \draw[->] (q1.south) edge node {$\varepsilon$} (q0.south);     \end{tikzpicture}       gives ![result](http://i.stack.imgur.com/wHF9y.png) note the arrow-tip that appears at the arrow base (where it connects q1). it appears every time the source anchor is specified (ie. (q1.south) rather than (q1)). Specifying such an anchor for the arrow head (q0) works fine. My workaround was drawing it white               \draw[->,white] (q1.south) edge[black,bend left] node {$\varepsilon$} (q0.south);      which is better, but a carful eye can still see a white arrow-tip at the arrow base.


title: embed 2 side by side figures in a two column style. (not spanning the whole page, just say the second column)

text: I have a typical 2 columns journal template. I wanted to insert two side by side figures in the second column. How can I do that. My current code goes like this, but the figures never showed up. [Image path is okay. not a problem of that] I edited my file so hopefully you can directly reproduce my problem. To reproduce, please create a directory `figure` under current dir, and put two image files `fig_1a.png` and `fig_1b.png` there..THX!!1 **---UPDATE---** And I got this warning.               Package multicol Warning: Floats and marginpars not allowed inside `multicols'      environment!.      which seems to suggest float is not supported here.               \documentclass[twoside]{article}     \renewcommand{\thesubsection}{\Alph{subsection} ) }     % ------     % Multiple figures      \usepackage{subcaption}     \usepackage{graphicx}     \DeclareGraphicsExtensions{.png,.jpg}     \graphicspath{{./figure/}}          % \graphicspath{/home/xushunyi/infocom/figure/}     % \newcommand{\figureroot}{/home/xushunyi/infocom/figure/}     % ------     % Fonts and typesetting settings     \usepackage[sc]{mathpazo}     \usepackage[T1]{fontenc}     \linespread{1.05} % Palatino needs more space between lines     \usepackage{microtype}               % ------     % Page layout     \usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt, left=2cm, right=2cm]{geometry}     \usepackage[font=it]{caption}     \usepackage{paralist}     \usepackage{multicol}          % ------     % Lettrines     \usepackage{lettrine}               % ------     % Abstract     \usepackage{abstract}         \renewcommand{\abstractnamefont}{\normalfont\bfseries}         \renewcommand{\abstracttextfont}{\normalfont\small\itshape}               % ------     % Titling (section/subsection)     \usepackage{titlesec}     \renewcommand\thesection{\Roman{section}}     \titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{}               % ------     % Header/footer     \usepackage{fancyhdr}         \pagestyle{fancy}         \fancyhead{}         \fancyfoot{}         \fancyhead[C]{Journal paper template $\bullet$ April 2012 $\bullet$ Vol. XXI, No. 1}         \fancyfoot[RO,LE]{\thepage}               % ------     % Clickable URLs (optional)     \usepackage{hyperref}          % ------     % Maketitle metadata     \title{\vspace{-15mm}%         \fontsize{24pt}{10pt}\selectfont         \textbf{Long Titles Look More Impressive Than Short Ones}         }        \author{%         \large         \textsc{Jonathan S. Doe}\thanks{Template by \href{http://www.howtotex.com}{howtoTeX.com}} \\[2mm]         \normalsize University of Technology, Delft \\         \normalsize \href{mailto:frits@howtoTeX.com}{frits@howtoTeX.com}         \vspace{-5mm}         }     \date{}                    %%%%%%%%%%%%%%%%%%%%%%%%     \begin{document}          \maketitle     \thispagestyle{fancy}          \begin{abstract}     \noindent I am abstract          \end{abstract}               \begin{multicols}{2}          hendrerit aliquet porttitor.          \section{Introduction}     This is intro     \begin{compactitem}     \item     ccccccccccccccccccccinformed decision     \item      bbbbbbbbbbbbbbbbnetwork.      \item      aaaaaaaaaaaa     \end{compactitem}          \begin{itemize}     \item werwerwerwerwerwer     \item sdgfsdfswerwrwerwer     \item gsdgsgsdgsdgdgsgsdgsdg     \item ...     \end{itemize}          Two figures standing side by side spanning the second columns should appear here. But I see nothing!!!!                     \begin{figure}[!h]     \centering     \begin{subfigure}[h]{0.45\columnwidth}       \centering       \includegraphics[width=.4\columnwidth]{fig_1a}       \caption{1a}       \label{fig:sfig1}     \end{subfigure}%     \begin{subfigure}[h]{0.45\columnwidth}       \centering       \includegraphics[width=.4\columnwidth]{fig_1b}       \caption{1b}       \label{fig:sfig2}     \end{subfigure}     \caption{plots of....}     \label{fig:fig1}     \end{figure}          what do you think is the reason?          \section{Algorithm Design}          \section{Evalutation}          \section{Conclusion}          \end{multicols}          \end{document}


title: Seeking advice for my clumsy math homework template

text: I typed my math homework with LaTeX. This was my first try on making some document with LaTeX. I can Google for math symbols, so it's okay, but the overall structure is really clumsy; especially spacing. Any advice would be really appreciated.               \documentclass[11pt,letterpaper]{article}     \setlength{\topmargin}{-.5in}     \setlength{\textheight}{9in}     \setlength{\oddsidemargin}{.125in}     \pagestyle{plain}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}          \makeatletter     \newcommand{\rmnum}[1]{\romannumeral #1}     \newcommand{\Rmnum}[1]{\expandafter\@slowromancap\romannumeral #1@}     \makeatother          \begin{document}          \title{Assignment#2\\MTH000}     \author{MY NAME\\student number}          \maketitle          \begin{theorem}{\textbf{Problem 4.1}}      \end{theorem}          \begin{proof}     \vspace{1mm}     \qquad (1) $f$ is not a function because $f$ does not satisfy the condition that if $(x,y) \in f$ and $(x,z) \in f$ then $y=z$. That is, $(1,4) \in f$ and $(1,2) \in f$, but $4 \neq 2$.          \vspace{1mm}     \qquad (2) $f$ is not a function because $f$ does not satisfy the condition that if $x \in A$ then there exists $y \in B$ such that $(x,y) \in f$.     \newline while $4 \in A$, there is no $y \in B$ such that $(4,y) \in f$.          \end{proof}     \vspace{5mm}     \begin{theorem}{\textbf{Problem 4.3}}      Given: $A=\{1,2\}, B=\{1,2,3\}$     \end{theorem}          \begin{proof}     \vspace{1mm}     \qquad The set of all $f:A \to B$ is $f = \{(1,1),(1,2),(1.3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)\}$     \end{proof}               \begin{theorem}{\textbf{Problem 4.5}}      \end{theorem}          \begin{proof}     \vspace{1mm}     \qquad      \vspace{1mm}     \qquad           \end{proof}     \vspace{5mm}               \begin{theorem}{\textbf{Problem 4.6}}      \end{theorem}          \begin{proof}     \vspace{1mm}       \qquad (\rmnum{1}) The image of $f$ is $\{2,4,5\}$\\     \vspace{1.5mm}       \qquad \quad (\rmnum{2}) $f^{-1}(\{3,4\})$ does not exist, as there is no $x$ such that $f(x)=3$\\     \vspace{.1mm}     \qquad \quad (\rmnum{3}) $f(\{1,2,4\})=\{2,4\}$\\     \vspace{2mm}     \qquad \quad (\rmnum{4}) $f^{-1}(\{3\})$ does not exist, as there is no $x$ such that $f(x)=3$.     \vspace{1mm}       \qquad \quad \ (\rmnum{5}) $f(f^{-1}(\{2,3\}))$ does not exist, because $f^{-1}(\{2,3\})$ does not exist, as there is no $x$ such that $f(x)=3$.     \end{proof}     \vspace{5mm}               \begin{theorem}{\textbf{Problem 4.7}}      \end{theorem}          \begin{proof}     \vspace{1mm}     \qquad $f(1)=2$, $f(2)=4$, $f(3)=3$, $f(4)=6$, $f(5)=1$, \\     \vspace{0.5mm}     \qquad and $g(1)=4,g(2)=4,g(3)=1,g(4)=3,g(5)=2,g(6)=2$.     \vspace{2mm}     \end{proof}          \begin{proof}     \vspace{1mm}     \qquad $g \circ f:A \to C$ is : \\     \vspace{1mm}     \qquad $g \circ f(1) = g(f(1)) = g(2) = 4$ \\     \vspace{1mm}     \qquad $g \circ f(2) = g(f(2)) = g(4) = 3$ \\     \vspace{1mm}     \qquad $g \circ f(3) = g(f(3)) = g(3) = 1$ \\     \vspace{1mm}     \qquad $g \circ f(4) = g(f(4)) = g(6) = 2$ \\     \vspace{1mm}     \qquad $g \circ f(5) = g(f(5)) = g(1) = 4$ \\     \vspace{5mm}     \end{proof}          \begin{theorem}{\textbf{Problem 4.}}      \end{theorem}          \begin{proof}     \vspace{1mm}     \qquad      \vspace{1mm}     \qquad           \end{proof}     \vspace{5mm}                    \end{document}


title: tikz array indexing to paint with custom palette

text: I have a custom palette which I want to paint with it by indexing. Here is my attempt:               \documentclass{standalone}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}          \def\colorPallete{{0.00 0.00 0.52, 0.00 0.77 1.00, 1.00 0.98 0.00, 0.73 0.00 0.00}}          \foreach \x [count=\n] in {0,...,3}{%     \definecolor{currentColor}{rgb}{{\colorPallete[\x]}}     \fill [fill=currentColor] (\n,-2) circle[radius=.3];     }     \end{tikzpicture}     \end{document}      The problem is that the parser cannot deal with the rgb triplet, because if I use a similar array indexation to modify some other parameter like int the following example it works.               \documentclass{standalone}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}          \def\radiousCollection{{.1, .2, .3, .4}}     \foreach \x [count=\n] in {0,...,3}{%     \fill [fill=black] (\n,-2) circle[radius={\radiousCollection[\x]}];     }     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/3yqxW.png) A possible workaround is to split the three planes of the color palette into three different arrays then the indexation works as in the case of the radious.               \documentclass{standalone}     \usepackage{tikz}     \begin{document}\tiny     \begin{tikzpicture}          \def\colorPalleteR{{0.00, 0.00, 1.00, 0.73}}     \def\colorPalleteG{{0.00,  0.77,  0.98,  0.00}}     \def\colorPalleteB{{1.0,  1.00,  0.00,0.00}}          \foreach \x [   count=\n,                 evaluate=\x as \myRval using ({\colorPalleteR[\x]}),                 evaluate=\x as \myGval using ({\colorPalleteG[\x]}),                 evaluate=\x as \myBval using ({\colorPalleteB[\x]}) ] in {0,...,3}{%          \definecolor{MyColor}{rgb}{\myRval,\myGval,\myBval}     \fill [fill=MyColor] (\n,0) circle[radius=.3];     \draw   (\n,.8) node {R=\myRval}             (\n,.6) node {G=\myGval}             (\n,.4) node {B=\myBval};     }     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Ii98L.png) Can anyone explain how shall be used in order to parse vectors properly so that there is no need to split the palette by planes?


title: How to set -dAutoRotatePages#/None in MikTeX

text: I'm using MikTeX 2.9 on Windows 7. I understand one needs to tell GS explicitly not to auto rotate pages by supplying:               -dAutoRotatePages#/None      as parameter to `ps2pdf` (or `gswin32c`, as indicated here). Is there a way to also supply this parameter to `\MiKTeX-2.9\miktex\bin\latex.exe`? That is, can I run something like:               latex.exe [parameter] main.tex      and the produced DVI will not exhibit undesired autorotated pictures? The reason for asking this is that I use Texniccenter, and the build setup (to DVI) only allows to pass options to `latex.exe`.


title: Adding indents to the ToC without adding dotted lines between sections

text: I wanted to add indents to format my ToC so I added the tocloft package I saw recommended on other threads. Now the indentation is perfect, but there is a dotted line in between each section in the actual body of the article. For example, it shows: > 1.1 Method. > > 1.1 ...................................... Before it would have only shown that first line, not the second line with the second set of numbers and the dotted line. How do I get rid of that?               \documentclass[11pt]{amsart}     \usepackage{tocloft}          \begin{document}          \setcounter{tocdepth}{4}     \tableofcontents     \newpage          \section{Experiment 1}     \subsection{Method}     \subsubsection{Participants}     \subsubsection{Stimuli}     \subsubsection{Procedure}     \subsection{Results}          \end{document}


title: How do I write something beside math text?

text: I have some giant matrices or systems of equations that are getting in my way of my text. Basically is hard enough to write them all in the same line, but when I want to write something beside it, it's a hopeless task for instance               $\left\{\begin{matrix}     f_x(x,y,z) = 0 \\      f_y(x,y,z) = 0 \\      f_z(x,y,z) = 0\\     \end{matrix}\right. \iff      \left\{\begin{matrix}      y = 0 \\       x = 0 \\       z = 0\\      \end{matrix}\right. \iff      \left\{\begin{matrix}       y = 0 \\        x = 0 \\       z = \frac{1}{2}\\     \end{matrix}\right.$ I can't write anything here "beside" it because it's just going to get cut off and goes under the system of equations


title: formatting natural table header with conTeXt

text: I am struggling with my table formatting a bit and hope there is someone around here that can give me some help. This is the table I have at the moment.               \bTABLE         \startTABLEhead             \bTR \bTD No. \eTD \bTD[nc=2] Length              \eTD \eTR             \bTR \bTD               \bTD [m] \eTD \bTD [inch] \eTD \eTR         \stopTABLEhead         \startTABLEbody             \bTR \bTD 1.  \eTD \bTD 1        \eTD \bTD 25.4   \eTD \eTR         \stopTABLEbody     \eTABLE      now I want a rule on top of the first row and on the bottom of the second row. That's simple enough only I would like to do this by using something like this               \setupTABLE[frame=off]     \setupTABLE[header][first][topframe=on]     \setupTABLE[header][last][bottomframe=on]      This way I can use this setup on all the tables in my document. Can this be done?


title: How to enter address and email in the following form

text: How to do I enter address and email as in the below format (with the address in all caps and email in italics and in some other font)? I am using LaTeX. HOME ADDRESS   E-mail address: emailaddy@someschool.edu Go to the last page here ( page 30 http://arxiv.org/pdf/1205.5714.pdf ) to see what I mean. tex.stackexchange won't let me post images until I earn at least 10 points. So I apologize for the inconvenience. And thanks for your time.


title: Customization of List of Tables and List of Figures title

text: I'm working on my thesis, and need a list of figures and list of tables. However, in the book document class I'm using the default format is not a format I can use. I did find a fix for the Table of Contents, however when I try to implement it with the others it crashes when I have a new section. Here is the TOC fix:               \makeatletter     \renewcommand\tableofcontents{%       \null\hfill\textbf{\normalsize{TABLE OF CONTENTS}}\hfill\null\par      \hfill{\textbf{Page}}%       \@starttoc{toc}%     }     \makeatother      Which results in this: ![enter image description here](http://i.stack.imgur.com/SFzhw.jpg) When I tried it with the List of Tables I did this:               \makeatletter     \renewcommand\listoftables{%       \null\hfill\textbf{\normalsize{LIST OF TABLES}}\hfill\null\par      {\textbf{Tables}}\hfill{\textbf{Page}}%       \@starttoc{lot}%     }     \makeatother      This gives me the outcome I want, and it works with tables: ![enter image description here](http://i.stack.imgur.com/wgffk.jpg) However, when I use `\chaper{}`, or some other section command, it causes the file to crash to the point that I have to recover a previous version for it to run again. Even when I try to delete the chapter title, the file won't compile again. Any help you could give me would be great. Here is a working file as requested, when I put in a figure or table it compiles fine. It only crashes when I put in a section or chapter.               \documentclass[12pt, oneside]{book}               \makeatletter     \renewcommand\tableofcontents{%       \null\hfill\textbf{\normalsize{TABLE OF CONTENTS}}\hfill\null\par      \hfill{\textbf{Page}}%       \@starttoc{toc}%     }     \makeatother          \makeatletter     \renewcommand\listoftables{%       \null\hfill\textbf{\normalsize{LIST OF TABLES}}\hfill\null\par      {\textbf{Tables}}\hfill{\textbf{Page}}%       \@starttoc{lot}%     }     \makeatother          \makeatletter     \renewcommand\listoffigures{%       \null\hfill\textbf{\normalsize{LIST OF FIGURES}}\hfill\null\par      {\textbf{Figure}}\hfill{\textbf{Page}}%       \@starttoc{lof}%     }     \makeatother                    \begin{document}          \frontmatter                    \tableofcontents               \addcontentsline{toc}{section}{LIST OF TABLES}     \listoftables               \addcontentsline{toc}{section}{LIST OF FIGURES}     \listoffigures                    \end{document}


title: Long dashes for denoting omitted columns of a matrix

text: Mathematicians would often to like to think of a row of a m by n matrix with entries from a , say, field, as a vector in the n-dimensional vector space over the field. Though I am not a mathematician yet, I am stuck with a situation where my proof becomes significantly simpler if I did not care about the entries of the row but just think of it as a vector. For instance, I'd like my rows to look like how the columns look here. The code for one of the matrices there:               $P=     \begin{bmatrix}      \biggl |& \biggl|&\biggl|\\     x_1&x_2 &x_3\\     \biggl|&\biggl|&\biggl|     \end{bmatrix}$      I'd be grateful if some one helped me.


title: How can I horizontally align the bars of two barplots

text: I would like to align the clusters of the two barplots of the figure below. For instance, I would like that the cluster of "Program-2" on the second bar appeared just below the "Program-2" cluster of the first barplot and positions, for those clusters that does not appear on the second barplot, just appear empty (without labels too). Is that possible? How can I do that? ![enter image description here](http://i.stack.imgur.com/XZ7Yz.png) Here is a minimum sample:               \documentclass{standalone}          \usepackage{tikz,pgfplots}         \usepgfplotslibrary{groupplots}         \usetikzlibrary{calc}          % Define bar chart colors     %     \definecolor{corA}{HTML}{666666}     \definecolor{corB}{HTML}{00FF84}     \definecolor{corC}{HTML}{00994D}     \definecolor{corD}{HTML}{00DD6F}               \pgfplotsset{compat=1.9}     \usetikzlibrary{patterns}               \begin{document}         \begin{tikzpicture}             \begin{groupplot}[                 ybar,                 group style         =   {                        group size      =   1 by 2,                     vertical sep    =   5.5cm                  },                 ymajorgrids         =   true,                 enlarge x limits    = 0.03,                 ymin                = 0,                 ymax                = 2,                 width       = 3.00*\textwidth,                 height      = 8cm,                 major x tick style   = transparent,                 ybar = 2*\pgflinewidth,                 xtick=data,                 y tick label style= {                     font=\Large                  },                 x tick label style= {                     rotate=90,                     anchor=east,                     font=\Large                 },                 symbolic x coords = {            ,-,                                         Program-1,                                         Program-2,                                         Program-14,                                         Program-3,                                         Program-8,                                         Program-9,                                         Program-10,                                         Program-16,                                         Program-4,                                         Program-5,                                         Program-15,                                         Program-6,                                         Program-7,                                         Program-13,                                         Program-11,                                         Program-12,                                     },                 legend cell align    = left,                 legend columns       = 4,                 legend image code/.code={%                     \draw[#1] (-0.1cm,-0.1cm) rectangle (0.10cm,0.2cm);                 },                 legend style         = {                     at={(0.800, 2.80)},                     anchor=north,                     column sep=1ex                 }             ]                       %  First Part  First Part  First Part  First Part  First Part First Part              %  First Part  First Part  First Part  First Part  First Part First Part              %  First Part  First Part  First Part  First Part  First Part First Part              %  First Part  First Part  First Part  First Part  First Part First Part              %  First Part  First Part  First Part  First Part  First Part First Part              %  First Part  First Part  First Part  First Part  First Part First Part              \nextgroupplot[ylabel style={font=\huge}, ylabel={Results of xyz}]                       %%%%%%%%%%%%%%%%%%%%%%             %%%% Resultados do A             \addplot[style={corA, fill=corA, mark=none}]                 coordinates {                        (Program-1,             1.03)                     (Program-2,             1.60)                     (Program-14,            1.00)                     (Program-3,         2.00)                     (Program-16,                0.91)                     (Program-4,                 0.91)                     (Program-5,                 1.00)                     (Program-15,                    1.41)                     (Program-6,                 1.60)                     (Program-7,                     1.55)                     (Program-8,             1.02)                     (Program-9,                 1.00)                     (Program-10,                1.00)                     (Program-13,            1.05)                     (Program-11,            1.23)                     (Program-12,            1.78)                 };                  %%%%%%%%%%%%%%%%%%%%%%             %%%% Resultados do B             \addplot[style={corB,fill=corB,mark=none}]                  coordinates {                     (Program-1,             0.92)                     (Program-2,             1.60)                     (Program-14,            1.08)                     (Program-3,         1.00)                     (Program-16,                0.18)                     (Program-4,                 0.20)                     (Program-5,                 0.26)                     (Program-15,                    0.89)                     (Program-6,                 0.52)                     (Program-7,                     0.39)                     (Program-8,             1.02)                     (Program-9,                 1.00)                     (Program-10,                1.00)                     (Program-13,            0.62)                     (Program-11,            0.66)                     (Program-12,            0.71)                 };                       %%%%%%%%%%%%%%%%%%%%%%%%%%%             %%%% Resultados do C             \addplot [style={corC,fill=corC,mark=none}]                  coordinates {                     (Program-1,             1.03)                     (Program-2,             1.60)                     (Program-14,            1.00)                     (Program-3,         2.00)                     (Program-16,                0.07)                     (Program-4,                 0.09)                     (Program-5,                 0.38)                     (Program-15,                    0.49)                     (Program-6,                 0.73)                     (Program-7,                     0.52)                     (Program-8,             1.02)                     (Program-9,                 1.00)                     (Program-10,                1.00)                     (Program-13,            0.14)                     (Program-11,            0.16)                     (Program-12,            0.21)                 };                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%             %%%% Resultados do C Unrolled             \addplot [style={corD,fill=corD,mark=none}]                  coordinates {                     (Program-1,             1.03)                     (Program-2,             1.60)                     (Program-14,            1.00)                     (Program-3,         2.00)                     (Program-16,                0.40)                     (Program-4,                 0.46)                     (Program-5,                 0.83)                     (Program-15,                    1.42)                     (Program-6,                 1.45)                     (Program-7,                     1.55)                     (Program-8,             1.02)                     (Program-9,                 1.00)                     (Program-10,                1.02)                     (Program-13,            0.72)                     (Program-11,            0.97)                     (Program-12,            1.39)                 };                                                                                %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              %  Second Part  Second Part  Second Part  Second Part  Second Part Second Part              \nextgroupplot[ylabel style={font=\huge}, ylabel={Results of ijk}]                                 %%%%%%%%%%%%%%%%%%%%%%             %%%% Resultados do A             \addplot[style={corA, fill=corA, mark=none}, x tick style={blue}]                 coordinates {                     (Program-1,     0.00)                     (Program-2,     1.46)                     (Program-3,     1.04)                     (Program-4,     1.15)                     (Program-5,     0.88)                     (Program-6,     0.95)                     (Program-7,     1.41)                     (Program-8,     1.07)                     (Program-9,     1.04)                     (Program-10,    1.00)                     (Program-11,    1.30)                     (Program-12,    1.38)                 };                  %%%%%%%%%%%%%%%%%%%%%%             %%%% Resultados do B             \addplot[style={corB,fill=corB,mark=none}]                  coordinates {                     (Program-2,             1.49)                     (Program-3,         1.05)                     (Program-4,                 0.85)                     (Program-5,                 0.83)                     (Program-6,                 0.87)                     (Program-7,                     1.09)                     (Program-8,             1.06)                     (Program-9,                 1.01)                     (Program-10,                0.99)                     (Program-11,            0.69)                     (Program-12,            0.69)                 };                       %%%%%%%%%%%%%%%%%%%%%%%%%%%             %%%% Resultados do C             \addplot [style={corC,fill=corC,mark=none}]                  coordinates {                     (Program-2,         1.34)                     (Program-3,         1.04)                     (Program-4,         0.46)                     (Program-5,         0.60)                     (Program-6,         0.95)                     (Program-7,         1.41)                     (Program-8,         1.03)                     (Program-9,         0.96)                     (Program-10,        0.98)                     (Program-11,        0.52)                     (Program-12,        0.56)                 };                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%             %%%% Resultados do C Unrolled             \addplot [style={corD,fill=corD,mark=none}]                  coordinates {                     (Program-2,         1.34)                     (Program-3,         1.04)                     (Program-4,         0.85)                     (Program-5,         0.83)                     (Program-6,         0.95)                     (Program-7,         1.41)                     (Program-8,         1.04)                     (Program-9,         1.04)                     (Program-10,        1.00)                     (Program-11,        0.88)                     (Program-12,        0.95)                 };                  \legend{A, B, C, D}                  \end{groupplot}              \end{tikzpicture}     \end{document}


title: Angle symbols in LaTeX

text: I will write a lot about Euclidean Geometry the next time. This means I need to denote angles. The symbol we use in class looks like `\sphericalangle`, but I've just seen that there is an `\angle` symbol / command: ![enter image description here](http://i.stack.imgur.com/eauBJ.png) Now I have three questions:   1. What is the semantic difference of those three symbols? (And maybe other symbols you know for angles)   2. `\measuredangle` is quite long and I don't think that I will need more than one symbol for angles (it depends on your answer to question 1). So I would like to re-define `\angle` so that I get the symbol of `\measuredangle`. I think the way to do this would be               \renewcommand{\angle}{\measuredangle}      is that correct? When I do this, is there any way to get the original symbol of `\angle`? (Not part of my main question, but I hope to get some comments about this: Is it a bad idea to use another symbol than `\angle`? How well-known is the difference of those symbols? (I know this is open, I just want to read what you think about it. I think semantics are important).)


title: Override firstinits=true for some entries in bib

text: I have a bib entry that is just a forum name and the URL. The problem is that all the bibliography is generated using firstinits=true. For this one with firstinits=true biblatex shortens the company name. Any idea?                @misc{UPNP,        author =       {{UP}n{P} {F}orum},        url =          {http://www.upnp.org},        urldate =      2014,      }      [For] U. Forum. Url: http://www.upnp.org If I left the author blank and put the content in organization/institution then the cite is only the year (BTW I'm using alphabetic IEEE).


title: Does a tool exist which can take a LaTeX equation and convert it to a format suitable for evaluation in Wolfram's Mathematica?

text: I use LaTeX to type up my homework, but as I work I often need to pop things into _Mathematica_ (or manually type them in, or manually use my Ti-89, etc) Currently, I've been manually translating things like `\frac{a}{b}` into (a/b) for _Mathematica_ 's consumption... is there a tool out there which does this automagically?


title: really greyscale pdf

text: I may miss something: I cannot produce really greyscale or monochrome pdf. If I create a very simple document, say `Hello`, with no or basic packages, `article` or `book`, and compile it with `pdflatex` (which I need to use for my project), the pdf appears as greyscale in Texmaker viewer, but not in Acrobat or Foxit readers. It is rich black (`RGYK`). I have another document, compiled by someone else with `pdflatex` or `pdftex`, which appears `greyscale OK` in Acrobat. It is the same even if I add `\usepackage[greyscale]{xcolor}`. I am working with Windows and usually compile with TexnicCenter (but TeXMaker does the same). Any idea ? MWE:               \documentclass[a4paper]{article}     \usepackage[monochrome]{xcolor}             \begin{document}       Hello         \end{document}


title: Does {1em} mean {1em plus0pt minus0pt}?

text: Is `plus0pt` and `minus0pt` automatically added if I write, e.g.,               \setlength{\abovedisplayskip}{1em}     \setlength{\jot}{0pt}     \setlength{\parsep}{0pt}     ...


title: In beamer class, how do I remove the additional vertical space before an itemize environment?

text: On a beamer slide, I want to produce something like ![](http://i.stack.imgur.com/lob7D.png) I use the following LaTeX code, which works well in LaTeX with the article class.               \begin{minipage}[t]{1.4cm}     Questions:     \end{minipage}\nobreak     \begin{minipage}[t]{9cm}     \begin{itemize}     \item 1st question;     \item 2nd question.     \end{itemize}     \end{minipage}      With the beamer class, however, I don't get the horizontal alignment correct: There is some additional vertical space above the itemize environment, and I don't manage to remove it. (Is it some `\topsep` or `\partopsep`? I tried the package enumitem, but this only made things worse.) What is a good way to solve this problem? Are there fixes for the `itemize`, or should I use a totally different approach? EDIT1: OK, with Juan's help I have father pinpointed the problem. Let me first elaborate on what the remaining alignment problem is: Yes, Juan, you're right, at the first sight it seems to be pixel perfect. But if you _really_ magnify (3000% or so), then you see that it isn't. It gets worse and much easier visible if you change "1st question" to "1st question $(*)$". You get perfect alignment if you change "1st question" to "Questions:" (really helpful ...). So the contents of the first `\item` really matters. I've checked with article class; there the alignment is 100% perfect. A very funny thing: In this case you _mustn't_ use the `\vspace{0pt}` hack since it destroys the desired alignment. EDIT2: Juan's answer provides a great fix for my problem, but to me it doesn't seem like the final solution. Is this strange behaviour of the beamer class a bug or a feature?


title: Clipping a figure to content

text: Is it possible to clip a figure inserted with `\includegraphics` to contents? That is, remove all surrounding whitespace.


title: How to automatically generate a list of linguistic examples with package linguex?

text: I am using the `linguex` package to present linguistic examples. However, I would like to make an appendix at the end which contains all the examples I've used and the page information. I am asking whether there exists any automatic way for that?


title: How to box two lines inside align*

text: I asked a similar question today except it was targeted at one particular line inside the `align*` environment. Now I want to enclose two lines. The failed attempt below makes my intention clear:               \begin{align*}     \ce{K_a $\times$ K_b} &= \ce{K_w}\\     -\log(\ce{K_a $\times$ K_b}) &= -\log\ce{K_w}\\      -( \log(\ce{K_a}) + \log(\ce{K_b}) ) &= -\log\ce{K_w} & \text{(Using log law for LHS.)} \\      - \log(\ce{K_a}) - \log(\ce{K_b}) &= -\log\ce{K_w}\\     \fbox{      \begin{minipage}{\textwidth}     \ce{pK_a} + \ce{pK_b} &= \ce{pK_w}\\     &=14.00 \text{ (at \SI{25}{\celsius})}\\     \end{minpage}     }     \end{align*}      `\Aboxed` from `mathtools` pkg was a great solution, you didn't have to specify mandatory parameters and it was as simple as `Aboxed{ }` - alas it only works for single line boxes. As for `\Aboxed` I don't want to be asked how wide the box should be - it should be automatically determined. As usual, I prefer predefined solutions, and less obstrusive code to achieve the desired effect. The less clutter the better. P.S. By the way, this manual seems to suggest `\mbox`, and anologously `\fbox` ought to draw frames around the enclosed content. Previously I could not get `\mbox` to display visible frames...


title: natbib in a different language?

text: I like using `natbib` for my author-year-style citations, but since I mainly write in swedish it would be nice if mine bibliography would be in swedish as well. Can `natbib` be persuaded to speak in swedish instead of english? Or should I go for another author-year citation package instead?