title: Coloring \underbracket?

text: Can I color just the `\underbracket` in text or presentation, without coloring the entire text and subtext contained in it? Because `{\color{red} \underbracket{Some text}_{Some other text}}` will color everything, and I don't need that.


title: includepdf and tableofcontents without numbering

text: I try to include an entire pdf file with pdfpages but I will not use numbering in the table of contents. Here is a MWE, which illustrates the problem.               \documentclass[a4paper]{scrreprt}     \usepackage{pdfpages}     \setcounter{tocdepth}{5}     \setcounter{secnumdepth}{5}     \begin{document}     \tableofcontents     \addchap{Test}     Only a test     \addsec{Another Test}     \includepdf[pages=-,addtotoc={1,section,1,{Another PDF},test}]{test.pdf}     \end{document}      I will not number the entry in the `toc` for the included pdf. Well, I can set the number, denoting depth of section to a higher value than `tocdepth`/`secnumdepth` (which is working, like `\includepdf[pages=-,addtotoc={1,section,` **6**`,{Another PDF},test}]{test.pdf}` ). Is there a smarter solution available?


title: How to properly install and use a new font with LuaLaTeX?

text: I have problems trying to get new fonts to work when compiling with LuaLaTeX. I'm working on Mac and use TexShop (with the `MacTeX` package). It goes like this: I downloaded for example the `Cardo` font; I installed the `Cardo` font (it now appears in the Font Book); I tried to compile a simple text that goes like this:               \documentclass[11pt]{book}     \usepackage[no-math]{fontspec}         \usepackage[frenchb]{babel}     \usepackage{amsmath}     \usepackage{unicode-math}     \setmainfont{Cardo}          \begin{document}     Hello world!     \end{document}      After compiling I obtained the following error message:               luaotfload | Font names database loaded: /Users/juan/Library/texlive/2012/texmf     -var/luatex-cache/generic/names/otfl-names.lua     luaotfload | Updating the font names database:     luaotfload | Scanning TEXMF fonts...     luaotfload | Scanning OS fonts...     luaotfload | Font names database saved: %s      : /Users/juan/Library/texlive/2012/texmf-var/luatex-cache/generic/names/otfl-names.lua          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     !     ./testBembo.tex:6: fontspec error: "font-not-found"     !      ! The font "Cardo" cannot be found.     !      ! See the fontspec documentation for further information.     !      ! For immediate help type H <return>.     !...............................................            l.6 \setmainfont{Cardo}          ?      Process aborted        * then I checked the `otfl-names.lua` and `Cardo` was missing;   * I then added the `Cardo` folder font to this folder:              /usr/local/texlive/2012/texmf-dist/fonts/        * I executed the `mkluatexfontdb -vvv` command in a terminal;   * I re-checked the `otfl-names.lua` and **`Cardo` was finally there**; So I naturally tried to compile the text again after resetting the computer and (as you might guess by now) I obtained (again!) the following error message:               luaotfload | Font names database loaded: /Users/juan/Library/texlive/2012/texmf     -var/luatex-cache/generic/names/otfl-names.lua     luaotfload | Updating the font names database:     luaotfload | Scanning TEXMF fonts...     luaotfload | Scanning OS fonts...     luaotfload | Font names database saved: %s      : /Users/juan/Library/texlive/2012/texmf-var/luatex-cache/generic/names/otfl-na     mes.lua          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     !     ./testBembo.tex:6: fontspec error: "font-not-found"     !      ! The font "Cardo" cannot be found.     !      ! See the fontspec documentation for further information.     !      ! For immediate help type H <return>.     !...............................................            l.6 \setmainfont{Cardo}          ?      Process aborted      The thing is driving me crazy! I migrated to LuaLaTeX **only** because I was promised to be able to use almost any font with it. What am I doing wrong?


title: Aligning text to bottom of page

text: I need to "justify" my text to the bottom of the page, like the image below. Is this possible? ![enter image description here](http://i.stack.imgur.com/ujd8o.jpg)


title: Table in itemize

text: Is it possible to include a table in itemize?               \begin{itemize}     \item item 1     \begin{tabu}[X X]     \toprule     150 & 150 \\ bottomrule     \end{tabu}     \item item 2     \end{itemize}      The alignment should be:   * Item 1 * * * 150 150 * * *   * Item 2


title: Suggestions for the format of text quoted

text: I am looking for the best form to quote external text from other authors, but with my version I am unhappy, cause --in my point of view-- it is poor and less visual than I liked to. This is my definition, that I put on the preamble of the document:               \def\cita{\advance\leftskip 2cm\advance\rightskip 1cm \sffamily \scriptsize}      When I want to cite text, I put this:               {\cita     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec elit dictum, mattis nibh in, aliquam nibh. Nullam varius lobortis condimentum. Quisque vel felis est. Mauris id tincidunt lacus, quis lobortis neque. Sed pretium placerat lorem eget ullamcorper. Curabitur ac turpis diam. Duis et tempor turpis, non luctus arcu.     \par}      which produces this type of output: ![enter image description here](http://i.stack.imgur.com/nHh45.png) I would appreciate any suggestion.


title: If-Then-Else clause in TIkZ Latex

text: I'm continuing my work on the "changeable" graphics. I have an array of values, and I have already succeeded in making variables from it. The next step is that I want to ignore the zero values. Here it is, what I have a problem with:               \pgfmathifthenelse{\myq==0}{}{\fill (B) circle (4pt)};      I thought this code should draw a circle in the node `B` in case the variable `\myq` has non-zero value. But I cannot even compile the code, compilation freezes. Can you figure out the possible problem or give an advice? The whole code is:               \begin{tikzpicture}     \def\zamkl{{3,4,4.5,5}}     \def\zamkh{{4,3.5,5,4.5}}     \def\zamkq{{20,0,30,0}}          \pgfmathparse{\zamkl[0]}     \edef\myl{\pgfmathresult}          \pgfmathparse{\zamkh[0]}     \edef\myh{\pgfmathresult}          \pgfmathparse{\zamkq[0]}     \edef\myq{\pgfmathresult}          \draw[help lines] (0,0) grid (2*\myl,2*\myh);          \coordinate (A) at (0,0);     \coordinate (B) at (\myl,0); \node at (B) [below] {$T$};     \coordinate (C) at (2*\myl,0);     \coordinate (D) at (2*\myl,\myh); \node at (D) [left] {$S$};     \coordinate (E) at (2*\myl,2*\myh);     \coordinate (F) at (\myl,2*\myh); \node at (F) [below] {$R$};     \coordinate (G) at (0,2*\myh);     \coordinate (H) at (0,\myh); \node at (H) [right] {$W$};          \draw [very thick] (A) -- (C) -- (E) --(G) -- (A);          \pgfmathifthenelse{\myq==0}{}{\fill (B) circle (4pt)};          \end{tikzpicture}


title: highlight both section and subsection in the outline on the side of a beamer slide

text: Currently only subsection highlighted on the outline on the side of the slide. Is it possible to change the template so when in a subsection the respective section stays highlighted.               \documentclass{beamer}     \mode<presentation>{\usetheme{Hannover}}     \begin{document}     \section{1}     \subsection{a}     \begin{frame}     stuff     \end{frame}     \subsection{b}     \begin{frame}     more stuff     \end{frame}     \end{document}


title: looping using both arabic numerals and actual numbers

text: Is there an easy way to loop this script in .tex:               \immediate\openout\mytest1=test1.tex     \immediate\openout\mytest2=test2.tex     \immediate\openout\mytest3=test3.tex     \immediate\openout\mytest4=test4.tex     \immediate\openout\mytest5=test5.tex      I think that a \foreach loop would work best, but I am very inexperienced with how latex sees the variables and appends them to text names. If someone could give me a jumping off point, that would be very helpful. @David: I am trying to use the example you created to loop the following:               \newwrite\mytest1     \newwrite\mytest2     \newwrite\mytest3     \newwrite\mytest4     \newwrite\mytest5     \makeatletter     \NewEnviron{test1}{%     \toks@=\expandafter{\BODY}%     \immediate\write\mytest1{\the\toks@}}     \makeatother          \makeatletter     \NewEnviron{test2}{%     \toks@=\expandafter{\BODY}%     \immediate\write\mytest2{\the\toks@}}     \makeatother          \makeatletter     \NewEnviron{test3}{%     \toks@=\expandafter{\BODY}%     \immediate\write\mytest3{\the\toks@}}     \makeatother          \makeatletter     \NewEnviron{test4}{%     \toks@=\expandafter{\BODY}%     \immediate\write\mytest4{\the\toks@}}     \makeatother          \makeatletter     \NewEnviron{test5}{%     \toks@=\expandafter{\BODY}%     \immediate\write\mytest5{\the\toks@}}     \makeatother      I kept your code in the body of the document, but moved the line \newwrite into a loop in the preamble to mimic the first five lines above. Then, I used the same language that you used to define the new environment: test1,test2, etc. Then I used the appended name in the \NewEnviron command. Ultimately, I would like the code to define a new environment for each count in the loop, then write that text into the new .tex files that we are creating. However, I am wondering the \NewEnviron is rejecting the name because of an expansion issue.               \makeatletter     \count@\z@     \loop     \advance\count@\@ne     \ifnum\count@<6     \expandafter\newwrite\csname mytest\the\count@ \endcsname     \expandafter\newwrite\csname test\the\count@ \endcsname     \NewEnviron{\csname test\the\count@ \endcsname}{%     \toks@=\expandafter{\BODY}%     \immediate\write\csname mytest\the\count@\endcsname{\the\toks@}}     \repeat


title: Subfigure column break in a 2 column document

text: My problem is that the subfigures do not wrap to the next column, instead they go off the bottom of the page. How can I add a break to the subfigure so that subfigures A-D are in one column, then E&F are in the next? Is this even an appropriate way to display a figure of this nature or should I make the figure span both columns? Here's an attempt at a minimal example: (I need to use XeLaTeX if it makes a difference).               \documentclass[11pt,oneside,a4paper,twocolumn]{article}     \usepackage{geometry}     \setlength{\oddsidemargin}{-7.9mm}     \setlength{\textwidth}{175mm}     \setlength{\topmargin}{-12.7mm}     \setlength{\headheight}{5.3mm}     \setlength{\headsep}{18mm}     \setlength{\textheight}{239mm}          \usepackage{float}     \usepackage{graphicx}     \usepackage{caption}     \usepackage{subcaption}     \usepackage{todonotes}     \setlength{\columnsep}{10mm}          \begin{document}     \begin{figure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 1}     \caption{this is a subfigure.}     \label{fig:sub_a1}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 1}     \caption{this is a subfigure.}     \label{fig:sub_b1}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 1}     \caption{this is a subfigure.}     \label{fig:sub_c1}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 1}     \caption{this is a subfigure.}     \label{fig:sub_d1}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 1}     \caption{this is a subfigure.}     \label{fig:sub_e1}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 1}     \caption{this is a subfigure.}     \label{fig:sub_f1}     \end{subfigure}     \caption{here is a collection of subfigures.}     \label{fig:subs}     \end{figure}          \begin{figure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 2}     \caption{this is a subfigure.}     \label{fig:sub_a2}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 2}     \caption{this is a subfigure.}     \label{fig:sub_b2}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 2}     \caption{this is a subfigure.}     \label{fig:sub_c2}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 2}     \caption{this is a subfigure.}     \label{fig:sub_d2}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 2}     \caption{this is a subfigure.}     \label{fig:sub_e2}     \end{subfigure}     \begin{subfigure}{80mm}     \missingfigure{part of figure 2}     \caption{this is a subfigure.}     \label{fig:sub_f2}     \end{subfigure}     \caption{here is another collection of subfigures.}     \label{fig:subs}     \end{figure}          \end{document}


title: Change header and footer to only a group of pages

text: I would like to change the header and footer to only a group of pages in my document. I'm using the `fancyhdr` package with these settings:               \usepackage{fancyhdr}     \pagestyle{fancy}          \makeatletter     \DeclareRobustCommand{\format@sec@number}[2]{{\normalfont\upshape#1}#2}     \renewcommand{\chaptermark}[1]{%       \markboth{\format@sec@number{\ifnum\c@secnumdepth>\m@ne\@chapapp\ \thechapter\, \fi}{#1}}{}}     \renewcommand{\sectionmark}[1]{%       \markright{\format@sec@number{\ifnum\c@secnumdepth>\z@\thesection\, \fi}{#1}}}     \makeatother          \fancyhf{}     \fancyhead[L]{\itshape\nouppercase{\rightmark}}     \fancyhead[R]{\thepage}      I would likt to not use these settings for some pages. How can I accomplish this?


title: Split a book into multiple volumes

text: I have a book with 15 chapters and a table of contents. I have been asked to repackage it as two separate volumes, one including Chapters 0-9 and the second including Chapters 9-14 (yes, Chapter 9 is in both volumes). I would like the page numbering in volume II to continue from volume I, and I would like the TOC for each volume to contain only the items that are actually in that volume. This seems fairly easy, except that I don't know how to make the page numbering in volume II start in the right place without including the aux files from volume I, thereby putting those in the volume II TOC as well. I'm sure this is a simple problem, but I can't find any help on google (or here). I am using the book document class, and it's probably too late to change to memoir.


title: verbatim within... a package delivers a string from a file and that string needs to be printed without interpretation

text: The csvtools package warns in its documentation from interpretable inputs but offers no solution as far as I can see. This Code generates a table               \documentclass{article}     \usepackage{csvtools}          \begin{document}          \newcommand{\DATARow}[4]{#1 & #2 & #3 & #4\\[.5ex]}          \setcsvseparator{;}          \CSVtotabular%     {stackoverflow.csv}%     {|c|c|c|c|}%     {\DATARow{ID}{REGISTER}{TYPE}{FORMULA}}%     {\DATARow{\insertID}{\insertREGISTER}{\insertTYPE}{\insertFORMULA}}%     {\DATARow{\insertID}{\insertREGISTER}{\insertTYPE}{\insertFORMULA}}          \end{document}      using this file as a source:               ID;REGISTER;TYPE;FORMULA     A_B_C_D;0xD000720C;UINT(16);$Y = \frac{57426}{10^8} \cdot X$     ONE;0xD020720C;UINT(8);$Y = 109 \cdot X$     TWO.FOUR;0xD080720C;INT(16);$Y = \frac{57426}{X}$     Thirty[2];0xD009720C;INT(8);$Y = X$     TreeHouse;0xD200720C;UINT(32);$Y = \frac{X}{10^8} \cdot X$      The problem is in the ID string: `A_B_C_D` it should be printed as is but gets interpreted as math and printed like `$A_{BCD}$` How can i modify the `DATARow` so that `A_B_C_D` is shown correctly?


title: \sffamily with \pgfplotstable

text: I'm trying to create a table using `pgfplotstable`. It works almost fine, just asking myself why `\sffamily` in front of `\pgfplotstabletypeset` is not working.


title: MiKTeX 2.9 portable issue

text: When I downloaded and updated MiKTeX 2.9 portable and try to change the paper size to `lettersize` under options, everything works fine. The paper size changes as desired but as soon as check for updates, it says that               miktex-dvipdfm-base-2.7     miktex-dvipdfmx-base-2.7     miktex-dvips-base     miktex-pdftex-base-2.9      needs to be repaired. If I do the update the paper size is switched A4 size again. The story repeats again if change back to letter size. Why is this happening and can this be fixed?


title: Why doesn't LaTeX typeset this reference normally?

text: **_I use the`bibtex` to add my reference.`Reference.bib` as below:_**               @Book{MathematicaIntroduction,      author = {袭宗燕著},      title = {数学软件Mathematica系统的应用及其程序设计[{M}]},      publisher = {北京大学出版社},      year = {1996},     }     @Article{InverseMethod,      author = {刘湘晨，蔡晓君，蒋力培，方徐应},      title = {机器人运动学分析与求解方法的探讨[{J}]},      journal = {机床与液压},      year = {2009},     }     @Book{RobotIntroduction,      author = {(美)Saeed B. Niku著},      title = {机器人学导论：分析、控制及应用[{M}]},      publisher = {电子工业出版社},      year = {2004},     }          @Manual{PrigrammingMethod,     title = {{B}uilding large software systems in {M}athematica},     author = {Wolfram Research},     organization = {Wolfram Research},     year = {2010},     }     @Article{SCARASimulationPID,     author = {Serhan Yamacli，Huseyin Canbolat},     title = {Simulation of a {SCARA} robot with {PD} and learning controllers[{J}]},     journal = {Simulation {M}odelling {P}ractice and {T}heory},     year = {2008},     }     @Article{DynamicEquation,     author = {陆金伟，李跃民},     title = {{SCARA}机器人的完整动力学显方程的推导[{J}]},     journal = {振动、测试与诊断},     year = {1995},     }          @MastersThesis{ChengDing,     author = {程汀},     title = {{SCARA}机器人的设计及运动、动力学的研究[{D}]},     school = {合肥工业大学},     type = {硕士论文},     year = {2008},     }          @MastersThesis{YuHuaDong,     author = {于华东},     title = {机器人动力学方程的符号法推导及快速计算[{D}]},     school = {北京工业大学},     year = {2002},     type = {硕士论文},     }          @Article{SCARAModel,     author = {Shutao Tang},     title = {A {M}odel of the {SCARA} {R}obot},     journal= {Wolfram Demonstrations Project},     year = {2014},     }      some parts of my paper example:               \documentclass[a4paper,cs4size,UTF8]{ctexart}     \begin{document}     \section{绪论}     \subsection{数学软件Wolfram Mathematica}          本文的主要是关于SCARA机器人的运动学和动力学研究，涉及到符号计算、数值计算和图形的可视化，这恰好是Mathematica所擅长的领域，因此首先对Mathematica做一个简单的介绍\cite{MathematicaIntroduction}。          在理论研究方面，文献\cite{ChengDing}对SCARA机器人的运动学和动力学进行了符号推导，并利用MATLAB分别进行了仿真，文献\cite{DynamicEquation}对SCARA机器人的动力学方程进行了显式推导，文献\cite{YuHuaDong}受当时计算机硬件水平的限制，采用Mathematica对5自由度的类Rm501机器人进行了动力学的符号推导。Serhan Yamacli和Huseyin Canbolat基于控制器的PD和learning的条件下仿真一种SCARA型机器人操作手\cite{SCARASimulationPID}，利用那些控制器来研究机器人的轨迹跟随性能，并分析了几种控制算法的控制性能。          文献\cite{RobotIntroduction}对D-H坐标系法的原理和使用方法给出了详细的说明，Denavit-Hartenberg(D-H)模型表示了对机器人连杆和关节进行建模的一种非常简单的方法，可用于任何机器人构型，而不管机器人的结构顺序和复杂程度如何。另外，它也可以用于表示全旋转的链式机器人、SCARA机器人或任何可能的关节和连杆组合          对于逆运动学的求解，本文将采用左乘逆矩阵(反变换法)\cite{InverseMethod}，它能够使得要求解的关节变量单独解耦出来          动力学Mathematica程序，将会以文献\cite{RobotIntroduction}P220页的二自由度连杆的动力学实例来进行测试          编写动力学程序的基础，编写程序采用模块化的思想\cite{PrigrammingMethod}，把整个程序划分成不可再分的子程序，这样做的目的是便于调试运行，提高效率。          Mathematica程序\cite{SCARAModel}建立SCARA工业机器人的动态模型，该模型能通过调整4个关节变量的参数来显示末端执行件的位置和姿态。          \newpage          \bibliographystyle{unsrt}             \bibliography{Reference}          \end{document}      **_aftering two compiling,it show as below :_** ![enter image description here](http://i.stack.imgur.com/PqjBC.jpg) **_So my question is why and how to revise it?Can someone help me?Thanks sincerely._**


title: Setting figure caption font face

text: I'd like to change font face of all figure captions. I'm currently using the `fontspec` package to set main font of the document. I'm also using `DeclareCaptionFormat` to set font size. I fail to see any way to set font face of captions. Is there some combination of `fontspec` and `caption` packages that allows to do that?


title: how to delete extra line in amsplain-url_bst.bst after URL

text: I use `amsplain-url.bst` for the bibliographic format. When a reference has a URL it adds an extra line before the end of the reference. I want to delete this extra line: ![incorrect output](http://i.stack.imgur.com/c9NZa.png)


title: labeling several diagrams

text: I have four diagrams at the same figure![enter image description here](http://i.stack.imgur.com/gtaY3.png), and I would like to label them from left to right: (a), (b), (c) and (d), how can I do that? thanks


title: New class base on book class with options

text: I created a class of my own that uses `book` as base class.               \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{manuscript}[2013/03/23 Creative writing manuscripts class]     \LoadClass[a4paper,12pt,oneside]{book}      The problem is that I want to be able to choose paper size and other options the `book` class has. The only way to do that is to redefine all the options the `book` class already has with the same values and pass it when I load the base class? Also, let's say I want to add a language option to my class so that if I choose Portuguese, for example, I want to load `babel` with portuguese. How can I create use the options already defined in `book` class to change the values of that class and use my new Portuguese option to load `babel` with that language.


title: How to make a new line in the source file but not the output

text: I want to adhere to the traditional '80 character' line length limit in my `.tex` source file. How do I do a new line in the source but not in the document output?


title: Wrapped figure on the left or right

text: I know how to wrap a figure with text and everything. But where is the best place to put it? On the left? On the right? Any good, reasonable ideas about that would be very much appreciated.


title: hhline - one "missing" line

text: I want to create a graphic with a tabular environment, but I can't figure out how I get a line under the "03" field.               \documentclass[paper=a4,ngerman,parskip=half,12pt]{scrartcl}     \usepackage{hhline}          \begin{document}          \begin{tabular}{|ccccc}     \hhline{---}     \multicolumn{1}{|c|}{10} & \multicolumn{1}{c|}{07} & \multicolumn{1}{c|}{05} & &\\\hhline{===-}     \multicolumn{1}{|c|}{01} & \multicolumn{1}{c|}{04}& \multicolumn{1}{c|}{18} & \multicolumn{1}{c|}{09} & \\\hhline{====-}     \multicolumn{1}{|c|}{06} & \multicolumn{1}{c|}{08} & \multicolumn{1}{c|}{11} & \multicolumn{1}{c|}{07} & \multicolumn{1}{c|}{03}\\\hhline{====}     \multicolumn{1}{|c|}{06} &  \multicolumn{1}{c|}{11} & \multicolumn{1}{c|}{07} & \multicolumn{1}{c|}{02} & \\\hhline{----}     \end{tabular}          \end{document}      ![enter image description here](http://i.stack.imgur.com/RM4eI.jpg)


title: How to make index entries refer to section numbers and/or figure/table numbers, and replace comma with leaders?

text: I'm new here, and I am not good at English. So I hope I do not offend you. :) One could use the package makeidx together with the program makeindex to generate index table in his/her LaTeX document, automatically. They are great tools, however, I'm not satisfied with the default outputting style. The default style uses a comma as separative sign of index entry name and the page number(s), and what I need is something like the default table of contents --- using leaders as separator and referring to the section numbers (but not page number). I've searched and read lots of posts on Internet, and this post seems to be the answer to the question. However, I don't know how to migrate them into my document. For these reasons, could I ask for a step by step answer?


title: Wrapping table headings in tabular

text: I have troubles wrapping text in my table headers even though I specify the column width with p{1cm}. How can I force a table cell width? The table main body is generated by stata and ideally the solution would not touch this part.               \documentclass{article}     \usepackage{booktabs, graphicx}          \begin{document}     \begin{table}[h]\caption{This is a test}     \resizebox{!}{!}{\begin{tabular}{l p{1cm} *{8}{l p{1cm}}} \toprule          % Autogenerated Stata code starts         &\multicolumn{8}{c}{}                                                           \\     &  CEO age &  CFO age &CEO fixed salary/total comp & CEO bonus/ total comp & CEO long term/total comp&CFO fixed salary/total comp&CFO bonus/total comp&CFO long> term/total comp\\      \midrule      CEO age         &        1&         &         &         &         &         &         &         \\     CFO age         &    0.259&        1&         &         &         &         &         &         \\     CEO fixed salary/total comp&   0.0241&  -0.0543&        1&         &         &         &         &         \\     CEO bonus/total comp&   0.0279&   0.0818&   -0.439&        1&         &         &         &         \\     CEO long term/total comp&  0.00776&   0.0724&   -0.315&   0.0119&        1&         &         &         \\     CFO fixed salary/total comp&  -0.0775&  -0.0854&    0.672&   -0.306&   -0.280&        1&         &         \\     CFO bonus/total comp&   0.0736&   0.0509&   -0.378&    0.794&  -0.0367&   -0.359&        1&         \\     CFO long term/total comp&   0.0742&   0.0382&   -0.319&  -0.0245&    0.814&   -0.325&  -0.0412&        1\\     % Autogenerated Stata code ends          \bottomrule     \end{tabular}}\end{table}          \end{document}      ![enter image description here](http://i.stack.imgur.com/Z3tZI.png)


title: Passing arguments to \def inside \newcommand (TikZ/PGF)

text: I'm having trouble passing an argument to `\pgfmathparse` inside a macro I defined. Here is the code:               \documentclass{article}          \usepackage{tikz}          \usetikzlibrary{calc}          \newcommand{\drawmestg}[2]{         \def\endpt{\pgfmathparse{#1+#2}\pgfmathresult}         \draw (0,0) -- (\endpt,0);     }          \begin{document}         \begin{tikzpicture}             \drawmestg{1}{1}         \end{tikzpicture}     \end{document}      I must confess, I'm quite clueless why I get the error:               Incomplete \iffalse; all text was ignored after line 14


title: Format a verbatim paragraph

text: How can I format a verbatim paragraph? I.e. break, fill and join input lines to produce globally balanced output with the lengths of each line approaching the target `\textwidth` as closely as possible. Using the `listings` package I can break lines, but I cannot join short lines.. That is, the following               \documentclass{article}     \usepackage{listings}      \lstnewenvironment{exampleA}{\lstset{%        language=,       basicstyle=\ttfamily,        breaklines=true,       prebreak=+,       postbreak=->,       columns=fullflexible,       breakindent=5pt} }{}      \begin{document}     \begin{exampleA}     Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line      Short Line      Short Line      Short Line      \end{exampleA}     \end{document}      produces ![enter image description here](http://i.stack.imgur.com/x2Hx7.png) What I would like to achieve is similar to what LaTeX does by default with paragraphs.. That is, e.g.               \documentclass{article}     \newenvironment{exampleB}{\tt}{}     \begin{document}     \begin{exampleB}     Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line      Short Line      Short Line      Short Line      \end{exampleB}     \end{document}      will produce: ![enter image description here](http://i.stack.imgur.com/i8NPP.png) The problem with using the latter approach is that I cannot use special symbols like `#` or `%` in the verbatim text.. So I need to use a verbatim environment like `lstlisting` or `fancyvrb`'s `Verbatim` environment. (As mentioned: in the `lstlisting` environment, automatic line breaking is possible, however for the `Verbatim` environment this feature seems also to be missing) **EDIT** : (This a comment to Frank's answer below) Now there seems to be a problem with lines becoming too short.. The following input               \noindent\hrulefill      \begin{myverbatim}       xxxxxxx xxxx xxxxx: 1234567890123456789012345,       123, 1234567890,     \end{myverbatim}     \noindent\hrulefill\\      now produces ![enter image description here](http://i.stack.imgur.com/mOBmV.png) (I would now like to have the word "123" at the end of the first line, as there are certainly plenty of space for it there :)) **Update** The above problem has now been solved, see comments in Frank's answer below..


title: Tikz matrix vertical alignment

text: I'm having trouble with the vertical alignment of the nodes in a tikz matrix. I have two plots next to each other. I want them to be aligned with respect to the center of their bounding boxes, but they end up aligned with respect to the zero coordinate (the abscissa in this case). Based on other questions (e.g., Aligning matrix nodes in tikz), I've tried with various combinations of `align=base`, `align=center`, `anchor=center`, etc, without success. Below is the code and corresponding output.               \documentclass{article}     \usepackage{tikz}          \begin{document}          \begin{figure}[h!]     \centering     \begin{tikzpicture}     \matrix [column sep=1cm, row sep=1cm, cells={xscale=0.7, yscale=2},     align=center, nodes={rectangle, anchor=center, align=center}]     {       \draw [->] (-4.2,0) -- (4.2,0);       \draw [->] (0,0) -- (0,1.3);       \draw [blue, ultra thick, domain=-4:4, samples=100] plot       (\x, {1/sqrt(1 + \x*\x)});       &       \draw [->] (-4.2,0) -- (4.2,0);       \draw [->] (0,-0.6) -- (0,0.6);       \draw [blue, ultra thick, domain=-4:4, samples=100] plot       (\x, {-0.4*pi*atan(\x)/180});       \\     };     \end{tikzpicture}     \caption{How to align?}     \end{figure}     \end{document}      ![enter image description here](http://i.stack.imgur.com/JD5gI.png) Any idea about how to vertically align the center of the cell's bounding boxes?


title: generation of sty file from dtx fails

text: I have implemented a dtx file with listings code according to the answer of this question: How to add listings environment to DTX files where the listings code is placed in the dtx file as               % \iffalse     % <*example>     % \fi     \begin{lstlisting}%     \usepackage{test}     \end{lstlisting}     % \iffalse     % </example>     % \fi      This works well to generate a pdf file. However with this ins file:               \input docstrip.tex     \keepsilent     \askforoverwritefalse     \generate{%       \file{test.sty}{\nopreamble\from{test.dtx}{test.sty}}%     }     \endbatchfile      I can not generate a valid sty file. It only contains:               \begin{lstlisting}%     \usepackage{test}     \end{lstlisting}          \endinput     %%     %% End of file `test.sty'.      where the dtx file is (for testing reduced to show the error) this one:               % \iffalse meta-comment     %     % \fi     %     % \iffalse     %<*driver>     \ProvidesFile{test.dtx}     %</driver>     %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]     %<package>\ProvidesPackage{test}     %<*package>     [2011/10/01 0.1 enhanced table commands for configurable table layout]     %</package>     %     %<*driver>     \documentclass{ltxdoc}     %\usepackage{test}     \EnableCrossrefs     \CodelineIndex     \RecordChanges     %     \RequirePackage{listings}     \lstloadlanguages{[LaTeX]TeX}     \begin{document}       \DocInput{test.dtx}       \PrintChanges       \PrintIndex     \end{document}     %</driver>     % \fi     %     % \GetFileInfo{test.dtx}     % \title{The \textsf{test} package}     % \author{Matthias Pospiech}     % \date{\fileversion~from \filedate}     %     % \maketitle     % \subsection{Loading}     % The package is loaded with     % \iffalse     % <*example>     % \fi          \begin{lstlisting}%     \usepackage{test}     \end{lstlisting}          % \iffalse     % </example>     % \fi     %     % \StopEventually{}     % \clearpage     % \section{Implementation}     %     % \iffalse     %<*package>     % \fi     %     %    \begin{macrocode}     \NeedsTeXFormat{LaTeX2e}[1994/12/01]     \ProvidesPackage{test}               [2011/10/01 v0.1 test]     %    \end{macrocode}     %     % \iffalse     %</package>     % \fi     %     % \Finale     \endinput      so actually the sty file should contain:               \NeedsTeXFormat{LaTeX2e}[1994/12/01]     \ProvidesPackage{test}          [2011/10/01 v0.1 test]      What is wrong ?


title: How do I change the header of table of contents with amsbook style file?

text: > **Possible Duplicate:**   >  Using the amsbook Class I am trying to change the header in the table of contents page with `amsbook` style file. I tried:               \makepagestyle{calification}     \makeheadrule{calification}{\textwidth}{\normalrulethickness}     \makeevenhead{calification}{\uppercase{new header}}{}{}     \makeoddhead{calification}{\uppercase{new header}}{}{}     \makeevenfoot{calification}{}{}{}     \makeoddfoot{calification}{}{}{}          \def\calification{     \newpage     \null\vfil     \clearpage     \pagestyle{calification}     }     \def\endcalification{\par\vfil\newpage}      And then use               \begin{calification}     \tableofcontents     \end{calification}      This does not work with `amsbook` -- for some reason it tells me that `\makepagestyle` is an undefined sequence:                ! Undefined control sequence.      l.46 \makepagestyle                    {calification}      Any ideas?


title: A \boxed alternative with nicer spacing?

text: I like using `\boxed` to emphasize my answers in homework problem sets. However, whenever I use superscripts/exponents inside the box, the box becomes taller than it seems it should. This causes two problems: the box looks bad, and it pushes other lines of text around. Here's an example. Notice that the line spacing doesn't get changed until I use an exponent inside a box. ![enter image description here](http://i.stack.imgur.com/yMinJ.png) Is there an alternative to `\boxed` that won't have this problem? Or some other good way to solve this issue?


title: \numcases with \tag

text: I would like to label some cases with specific tags, and was hoping for something like               \begin{numcases}{A = }     \frac{r}{a} & r > a \tag{G} \\     \frac{a}{r} & r < a \tag{H}     \end{numcases}      utilizing the `numcases`environment from the `cases` package, and `\tag` from `amsmath`. However, the two don't seem to be compatible: > `! Package amsmath Error: \tag not allowed here.` Is there any alternatives that would do what I hope to accomplish?


title: What is the simplest yet complete question to assess whether or not a person has a strong skill in plain TeX?

text: If I have to hire a person for doing a plain TeX related jobs, what question should I ask to the person? I want the question to be as simple as possible and it has to accommodate the maximum number of available aspects.


title: Formatting the index from the songs package

text: I've been using the `songs` package to generate songbooks. I've been tweaking the package for my needs, but one of the remaining issues is the `\showindex` command. Consider the following code:               \documentclass[a4paper]{book}     \usepackage[lyric]{songs}          \usepackage[Sonny]{fncychap}          \newindex{titleidx}{cbtitle}          \begin{document}          \showindex{My index}{titleidx}          \begin{songs}{titleidx}          \beginsong{Amazing Grace}[       by={John Newton},       sr={Luke 15:4; 2 Corinthians 4:8,9; Ephesians 2:8; Revelation 14:3},       cr={Public domain.}]          \beginverse     Amazing grace! How sweet the sound     That saved a wretch like me!     I once was lost, but now am found;     Was blind, but now I see.     \endverse          \endsong          \end{songs}          \chapter*{My chapter}          Hello world!          \end{document}      I like to use the `fncychap` package with the `Sonny` style, and it works for all my chapters/sections/indices, **except** for the index generated by the `\showindex` command. Is there a way to hack this command to make it compatible with the `fncychap` package?


title: Suppressing indentation of the next paragraph

text: I'm trying to define an environment/command, with the following property: The immediate paragraph after the environment must not be indented. The following shows my attempt at defining such environment/command:               \makeatletter         \newenvironment{NoIndEnv}{}{\par\@afterindentfalse\@afterheading}         \newcommand{\NoIndCmd}[1]{#1 \par\@afterindentfalse\@afterheading}         \makeatother      Now compare the following two:               \begin{NoIndEnv}        Text ...     \end{NoIndEnv}          Some text ...      and               \NoIndCmd{Text ...}          Some text ...      For some reason, the environment definition works only if it is placed after a `\section` command; i.e.:               \section{}          \begin{NoIndEnv}        Text ...     \end{NoIndEnv}          Some text ...      Could you please help me figure out what's wrong?


title: How to display the final value of a counter at the beginning of a document?

text: At the beginning of my document, I have created a counter using `\newcounter`. Over the course of the document, this counter is increases using `\stepcounter`. How can I display the final value of the counter in a place prior to the the final occurrence of `\stepcounter`, such as at the beginning of the document?


title: How to output the final value of some counter, like number of figures or tables in the middle of the document?

text: I need to put some formal statistics on the document itself somewhere in the middle, like "This document contains XXX figures and YYY tables (and may be even ZZZ formulas and PPP theorems)". Is there a common way to output the final value of some counter in the middle of the document? Edited after answering: I have asked a more specific question before, "How to output the number of bibliographic entries referenced in the document?", which is now deleted because the answer to this one covers also this case. For the reference, some useful counters, which can be used with totcount:   * `page` - page count   * `enumiv` - bibliography entries count   * `figure` - figures count   * `table` - tables count


title: Sum of counters at the beginning of file

text: New to this forum, but long time TeX and LaTeX user. I've had this problem recently, for which I couldn't find a solution: I'd like to print out the total possible score at a test at the top of the test. This is of course the total sum of scores of the different questions. I've thus thought of creating a counter               \newcounter{total}     \setcounter{total}{0}      at the beginning of the file, and at each question, I've used the command               \addtocounter{total}{ <the score at this question> }      But then, of course, the total score is effectively computed at the end of the document. How can I manage to print this score at the top of the document? Perhaps with a temporary external file, but I haven't looked into this... All help is greatly appreciated! Thanks a lot in advance!


title: pgfplots: get color setting from table

text: I want to plot multiple lines using pgfplots. Each of the lines should have a color, depending on the group it belongs to. In the example attached, a table is provided, containing all the coordinates for the lines and additional information which should be used to decide which color to use I tried a few things, but obviously I'm too unexperienced with LATEX/pgfplots. It would be cool if someone could give me a hint, Thanks, Tobi               \documentclass{article}       \usepackage{pgfplots}         \begin{document}            \pgfplotstableread{       % This table holds the coordinates for multiple lines sharing the same x-values.     % The x-values are provided in the first column, the y-values in the subsequent columns.     % The character in the first row indicates the group the line belongs to     t   a   a   a   b   b   c   c   c   c       -1  0   -2  -1  1   0   2   2   1   1       0   0   0   0   0   0   0   0   0   0       1   3   2   4   9   8   6   7   9   5       2   4.5 3   6   13  12  9   10  12  8       3   5.8 3.5 7   15  14  11  12  13  9       4   5.1 3.3 6.5 14  13  10  11  12  8.5       5   5   3.1 6.4 14  13  10  11  12  8.4       }\atable            % These are the colors I want to use for the 3 groups (a,b,c)       \definecolor{mycolorA}{named}{red}       \definecolor{mycolorB}{named}{green}       \definecolor{mycolorC}{named}{blue}            % Ok, let's plot the data       \begin{tikzpicture}           \begin{axis}[no markers]                    % Loop over columns present (If someone knows a shorter way to do this please let me know)               \pgfplotstablegetcolsof{\atable}               \pgfmathparse{\pgfplotsretval-1}               \foreach \i in {1,...,\pgfmathresult}              {% The loop starts here                             % Here somehow the character in the first row  has to be read out.                   % if the character in the first row of the current column \i                  % is equal to 'a' then use mycolorA, if 'b' use mycolorB etc                   \addplot table[x index=0,y index=\i] {\atable};                    }                \end{axis};       \end{tikzpicture}            \end{document}


title: How can I change links made by hyperref?

text: My document:               \documentclass[12pt,a4paper]{mwrep}     \usepackage{polski}     \usepackage[utf8]{inputenc}          \usepackage[hidelinks,unicode]{hyperref}          \usepackage[T1,OT4]{fontenc}     \usepackage{graphicx}     \usepackage{hypcap}          \let\origfigure\figure     \let\endorigfigure\endfigure          \makeatletter     \g@addto@macro\@floatboxreset\centering     \makeatother          \begin{document}          \tableofcontents     \listoffigures          \chapter{Bzdety}\label{rozdzial-bzdety}     W rozdziale \ref{rozdzial-bzdety} ze strony \pageref{rozdzial-bzdety}     znajduje się obrazek \ref{obraz-jesien} na stronie \pageref{obraz-jesien}.          The first paragraph.          \begin{figure}         \includegraphics{a.jpg}         \caption[Opcjonalny skrócony opis do spisu obrazków]{Opis}         \label{obraz-jesien}     \end{figure}          The second paragraph.     \end{document}      `hyerref` makes nice hyperlinks to captions of images. I can for example create list of figures. That is nice. But every link is going to caption and image is above it so reader needs to scroll up to see it. How can I change something in preamble so clicking on such hyperrlink leads to the top of image? I don't want to change anything outside preamble unless necessary.


title: venn diagram with TikZ

text: I'd like to create this Venn diagram in LaTeX (possibly with TikZ): ![enter image description here](http://i.stack.imgur.com/fbmcX.png) Could you point me in the right direction? I've seen lots of Venn diagram examples using TikZ but none with concentric circles.


title: How to type a particular kind of unit vector?

text: I write unit vectors frequently. Right now, the best thing going for me is to define:               \newcommand{\uvec}[1]{\boldsymbol{\hat{\textbf{#1}}}}      and then do `\uvec{i}`, `\uvec{j}`, and `\uvec{k}`. I like the results (they're clear enough), but I would prefer no dots for the `i` and `j` unit vectors. What's a nice, unified way to get that? I tried `\hat{\textbf{\i}}`, and that works ok, as does `\hat{\textbf{k}}`. The problem is that `\hat{\textbf{\j}}` doesn't work for me. For some reason, I don't get a `j`, but some rectangular blob of ink. `\jmath` and `\imath` don't work for me, because I don't want italics but bold-face. So, to sum up:   1. Want bold, not italic   2. Want a hat over the unit vector   3. Want no dot for the `i` or `j` unit vectors. How best to get all this? Thanks very much for your time! Here's a minimum working example: `\documentclass{article} \usepackage{amsmath} \newcommand{\uvec}[1]{\boldsymbol{\hat{\textbf{#1}}}} \begin{document} $\uvec{i}, \uvec{j}, \uvec{k}$ \end{document}` Please feel free to suggest the inclusion of other packages.


title: MiKTeX’s LuaLaTeX and minitoc: "I can't write on file ...mtc"

text: When compiling the code below with LuaLaTeX I get the error: "I can't write on file 'test.mtc'". Any ideas on how to resolve this? (Btw, the file test.mtc is there and contains the word "Contents")               \documentclass{report}     \usepackage{lipsum}          \usepackage[tight]{minitoc}     \dominitoc[n]          \begin{document}          \tableofcontents     \chapter{Test}     \minitoc     \lipsum     \section{Test}     \lipsum     \subsection{Test}     \lipsum     \subsubsection{Test}     \lipsum          \end{document}


title: Cite software/libraries using bibtex

text: I would like to cite some libraries I am using in a program using bibtex, but I can't quite figure out how to make that work properly. An entry might look like this:               @misc{CGAL,       key   = "CGAL",       title = "\textsc{Cgal}, {C}omputational {G}eometry {A}lgorithms {L}ibrary",       note  = "http://www.cgal.org"     }      The problem is that `@misc` is not working optimally for me: Specifically the key (using `\bibliographystyle{alpha}`) is CGA instead of CGAL and I don't know how to fix that. Can I define my own style for citing software or can I at least change the key that is used for referencing?


title: Error creating pdf/a with latex

text: I'm trying to create pdf/a through latex. I inserted in my tex file the package:               \usepackage[a-1b]{pdfx}      with the option `a-1b` but I got error:               pdfTeX error (ext5): cannot open file for embedding ...eam attr{/N 4} file{sRGBIEC1966-2.1.icm}     \pdfobjcompresslevel > 0 requires \pdfminorversion > 4. Object streams disabled now.      I don't really know what does it mean


title: Bold cross references

text: I'm writing my PhD thesis in LaTeX and I have a lot of figures - each one is referenced within the text. So I have:               \begin{figure}[h]     ...     ...     \label{fig:stuff}     \end{figure}      then, later, in the text:               blah blah blah this is shown in \ref{fig:stuff}, which indicates blah blah      and I get:               blah blah blah this is shown in Figure 2.7, which indicates blah blah      I want to make "Figure 2.7" bold - I'm loading the caption package with the `labelfont=bf` option so that it's bold in the caption of the figure itself, but I'd also like it to be bold in the text. I guess I could do this with               blah blah blah this is shown in \textbf{\ref{fig:stuff}}, which indicates blah blah      but ideally I'd like not to have to change multiple references to all 71 figures... Any ideas?


title: How to remove some pages from the navigation bullets in Beamer?

text: I'm making a `beamer` presentation using the `miniframes` outer theme, with navigation bullets, and the `subsection=false` option, meaning the bullets are all on a single row. The problem I have is that, if one section has too many pages, the bullets overflow to the next section:               Section 1 Section 2     oooooooooooooooooooo      I tend to have many frames, some of them just asking a question, leading to the next detailed frame. I don't really need those frames to be represented by navigation bullets, and removing them would fix the problem. Any idea how to do that? I could cheat by using overlays to have the question and the answer on the same frame, but that would be a mess... Code example to answer percusse's question: this should give you one circle per frame, not one per subsection. If you add many frames in one subsection, the circles will overflow over the next section.               \documentclass[compress]{beamer}     \useoutertheme[subsection=false]{miniframes}     \begin{document}     \section{S1}     \subsection{SS1}     \frame{1}     \frame{2}     \frame{3}     \subsection{SS2}     \frame{1}     \frame{2}     \frame{3}     ...     \end{document}


title: Remove a titlepage navigation dot in Beamer

text: I would like to remove the `navigation dot` in Beamer that corresponds to the title page. Here is a MWE. As you can see there is an empty dot for for the title page... how can I get rid of it? **NOTE** I use the trick here Beamer navigation circles without subsections? to remove `subsection` navigation dots.               \documentclass{beamer}     \usetheme{Frankfurt}     \usecolortheme{dove}     \usepackage{remreset}     \makeatletter     \@removefromreset{subsection}{section}     \makeatother     \setcounter{subsection}{1}          \setbeamertemplate{items}[circle]                \title{Stackexchange is great}     \author{John}     \date{\today}          \begin{document}          \begin{frame}[plain]       \titlepage     \end{frame}               \section{Motivation}          \begin{frame}{A sample slide}     hello     \end{frame}          \begin{frame}{A sample slide}     hello     \end{frame}          \begin{frame}{A sample slide}     world     \end{frame}     \end{document}


title: How to change font size mid document?

text: I want to create a TeX document for which the first (summary) page is `\documentclass[10pt]{article}`, but for which the rest of the document is `\documentclass[12pt]{article}`. Is there an easy way to do this?


title: Format time span for CV

text: I would like to add the month to the time span of _moderncv_. I order not to occupy much more space and still having a beautiful solution, I would like to do the following:   Year - Year   Month - Month   where   * there's just one dash vertically centered in between the two dates,   * the month is centered under the year   * the year is stretched to the cell width if necessary   * to occupy little space, there are no margins at all  I already did some experiments, but couldn't get the margins and the stretching right.               \documentclass{article}     \usepackage{tabu}     \usepackage[english]{babel}     \usepackage{datetime}          \newcommand* \hintscolumnwidth {0.2\textwidth} % best: 0.175\textwidth          \newcommand \testBb [4]{%          \begin{tabu} to \hintscolumnwidth {|@{} X[c m] @{--} X[c m] @{}|}          \hline \linespread{0}#2\newline \tiny #1&\linespread{0}#4 \newline\tiny #3 \\ \hline          \end{tabu}}          \newcommand \testB [4]{%          \begin{tabu} to \hintscolumnwidth {|@{} X[c m] @{}|@{} X[c m] @{}|}          \hline \linespread{0}#2\newline \tiny #1&\linespread{0}#4 \newline\tiny #3  \\\hline          \end{tabu}}          \newcommand \testA [4]{%         \begin{tabu} to \hintscolumnwidth {@{}|X[-1,m,c]|@{--}X[-1,m, c]|@{}}  %spread 2cm             \hline      {#2 } & #4 \\ \tiny #1 & \tiny #3\\ \hline          \end{tabu}}          \def \dateA [#1.#2-#3.#4]{ \testA{\monthname[#1]} {#2}  {\monthname[#3]}  {#4} }     \def \dateB [#1.#2-#3.#4]{ \testB{\monthname[#1]} {#2}  {\monthname[#3]}  {#4} }     \def \dateBb [#1.#2-#3.#4]{ \testBb{\monthname[#1]} {#2}  {\monthname[#3]}  {#4} }          \begin{document}%     \ \\     \dateA[09.2008-09.2012]\ \\     \dateB[09.2008-09.2012]\ \\     \dateBb[09.2008-09.2012]\ \\     2008--2012     \end{document}      Produces the following result:   ![Result](http://i.stack.imgur.com/UAqrm.png) Any suggestions how to make it even more beautiful are welcome. **Update:** I took one step back and solved it by just using boxes. My problem with them is that I have to replace \ by \newline if want to use them in the existing tabu cells. This messes up line spacing, e.g.               \documentclass{article}     \usepackage{tabu,xcolor}     \usepackage[ngerman]{babel}     \usepackage{datetime}          \newcommand* \datumsZellenBreite {11mm}     \newcommand* \datumsZifferMonatsAbstand{-0.8mm}     \newcommand \zeitspanneA[4]{%same as B, but uses \newline instead of \\ for linebreak         {\parbox{\datumsZellenBreite}{\centering{#2%         %\\%         \newline         \vspace{-2.8mm}\tiny #1}}}\hspace{\datumsZifferMonatsAbstand}{\raisebox{0.4mm}{\color{blue}$\rightarrow$}}\hspace{\datumsZifferMonatsAbstand}{\parbox{\datumsZellenBreite}{\centering{#4%         %\\%         \newline         \vspace{-2.8mm}\tiny #3}}}     }     \def \zeitA [#1.#2-#3.#4]{ \zeitspanneA{\monthname[#1]} {#2}  {\monthname[#3]}  {#4} }          \newcommand \zeitspanneB[4]{         {{\parbox{\datumsZellenBreite}{\centering{#2\\\vspace{-2.8mm}\tiny #1}}}\hspace{\datumsZifferMonatsAbstand}{\raisebox{0.4mm}{\color{blue}$\rightarrow$}}\hspace{\datumsZifferMonatsAbstand}{\parbox{\datumsZellenBreite}{\centering{#4\\\vspace{-2.8mm}\tiny #3}}}}     }     \def \zeitB [#1.#2-#3.#4]{ \zeitspanneB{\monthname[#1]} {#2}  {\monthname[#3]}  {#4} }          \begin{document}%     A should look like B, so it can be used inside tabu.\\ \ \\     \zeitB[09.2008-09.2012]\ B\\ \\     \zeitA[09.2008-09.2012]\ A\\ \\          \begin{tabu}{XX}     a & \zeitA[09.2008-09.2012] %can't use B here     \end{tabu}          \end{document}      Results in ![boxExample](http://i.stack.imgur.com/Bo6mS.png) **Update2:** I'm now pretty close to what I desire. Actually the `\baselineskip=-valA\newline\par\vspace{-valA}` to get the year-month spacing right seems like voodoo to me, but I should sacrifice a goat for finding it. The only thing that's undesired is that **A doesn't start at the same baseline as the digits do**.               \documentclass{article}     \usepackage{tabu,xcolor}     \usepackage[ngerman]{babel}     \usepackage{datetime}          \setlength\fboxsep{0pt}     \newcommand* \datumsZellenBreite {10.5mm}     \newcommand* \datumsZifferMonatsAbstand{-2.8mm}     \newcommand \zeitspanne[4]{%same as B, but uses \newline instead of \\ for linebreak         {\parbox{\datumsZellenBreite}{\centering{#2\baselineskip=\datumsZifferMonatsAbstand\newline\par\vspace{\datumsZifferMonatsAbstand}\tiny{\strut#1}}}}\hspace{-0.6mm}{\raisebox{0.35mm}{\color{blue}--}}\hspace{-0.2mm}%         {\parbox{\datumsZellenBreite}{\centering{#4\baselineskip=\datumsZifferMonatsAbstand\newline\par\vspace{\datumsZifferMonatsAbstand}\tiny{\strut#3}}}}%     }     \def \zeit[#1.#2-#3.#4]{\zeitspanne{\monthname[#1]}{#2}{\monthname[#3]}{#4}}          \begin{document}%     \begin{tabu}{@{}X[-1]@{}|X@{}}     \hline%     A & \zeit[09.2008-09.2012]     \\\hline     \end{tabu}     \end{document}      Produces: ![Datum3](http://i.stack.imgur.com/NIunz.png) Any ideas how I can fix this?


title: Creating metadata using \hypersetup

text: I'm trying to create metadata using `\hypersetup` but it doesn't work. Here are the commands I use               \usepackage[a-1b]{pdfx}     \usepackage{hyperref}     \hypersetup{         pdftoolbar=true,        % show Acrobat’s toolbar?         pdfmenubar=true,        % show Acrobat’s menu?         pdffitwindow=false,     % window fit to page when opened         pdfstartview={FitH},    % fits the width of the page to the window         pdftitle={title},    % title         pdfauthor={Salvatore Mazzarino},     % author         pdfsubject={Subject},   % subject of the document         pdfcreator={Salvatore Mazzarino},   % creator of the document         pdfproducer={Salvatore Mazzarino}, % producer of the document         pdfkeywords={Green Networking} {Mobile Cloud} {Network Coding} {Energy}, % list of keywords         pdfnewwindow=true,      % links in new window         colorlinks=false,       % false: boxed links; true: colored links         linkcolor=red,          % color of internal links (change box color with linkbordercolor)         citecolor=green,        % color of links to bibliography         filecolor=magenta,      % color of file links         urlcolor=cyan           % color of external links     }


title: PGFPlots error "Dimension too large" when plotting .csv data

text: I did search on here for a solution and I did read the manual, but i couldn't find an answer (or at least one that I understood). I am plotting some data in a .csv file and for some reason when the x axis value goes above 930.08 it gives the error "Dimension too large". What is strange, though, I have other data that does exceed 930.08 and that works fine, although it starts at 800, not 930 - this "erroneous" data is essentially a segment of larger data range but each sample is at a smaller samplerate (original data: start=800, increment=0.25, end= 1100, new data: start=930, increment: 0.01, end=960). The data which gives the error is               a,b,c     930.00,0.0001095886,0.03875491     930.01,0.0001499818,0.0448156     930.02,0.0001117049,0.03977829     930.03,0.0001122457,0.03972992     930.04,0.0001595432,0.04589581     930.05,9.773631e-05,0.03843789     930.06,0.0001590169,0.04583743     930.07,0.000153542,0.04522526     930.08,9.953637e-05,0.03739852      The data before 930.08 doesn't give the errors. The code I am using to plot the graph is:               \begin{center}         \begin{tikzpicture}             \begin{loglogaxis}[black,                 width=14cm,                 height=10cm,                 mark=none,                 xlabel=Scaling Factor,                 transpose legend,                 legend style={at={(0.5,-0.15)},anchor=north},                 legend entries={MSE, Accuracy},                 legend style={nodes=right}]                      \addplot[no markers,blue] table [x=a, y=b, col sep=comma,] {                     ./chapter4/refined2b.csv                 };                 \addplot[no markers,red] table [x=a, y=c, col sep=comma,] {                     ./chapter4/refined2b.csv                 };             \end{loglogaxis}         \end{tikzpicture}     \end{center}      Many thanks to anyone who responds.


title: An embarrassing Multline error

text: Here I am, trying to display an equation that takes way too long for one line, so I called multline.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{geometry}     \usepackage{amssymb,amsmath}     \usepackage{amsfonts}     \geometry{a4paper}       \begin{document}     \begin{multline}     S_E=\int \mathrm{d}t \left[\frac{(f'\dot{\xi})^2}{2} \int \mathrm{d}x(\phi_0+1)^2+\frac{f^2}{2}\int \mathrm{d}x \phi'^2\\     + \int \mathrm{d}x (\psi^2-1)^2(\psi^2-\delta_1)     + \frac{1}{\gamma+\psi^2}\left[\left(f^2(\phi_0^2+1)-2f(\phi_0+1)\right)^2-\frac{\delta_2{4}(f(\phi_0+1)-3)(f(\phi_0+1))^2\right]\right] \\     \label{actionrescale}     \end{multline}     \end{document}      However, if I called \begin{equation} and \end{equation} instead of \begin{multline} and \end{multline} the equation would show up just fine (or at least as much of it that could fit on the resulting pdf file). What exactly is wrong with this document?


title: pgfkeys 'filtering state'

text: Please does anyone know the 'filtering state' referred to in the following code from the pgfkeys-core file?               \def\pgfkeys@install@filter@and@invoke#1{%       \ifpgfkeysfilteringisactive         \pgfkeys@error{Sorry, nested calls to key filtering routines are           not allowed. Reason: It is not possible to properly restore the           previous filtering state after returning from the nested call}%       \fi       \pgfkeysfilteringisactivetrue       \let\pgfkeys@case@one=\pgfkeys@case@one@filtered       \let\pgfkeys@try=\pgfkeys@try@filtered       \let\pgfkeys@keyunknown=\pgfkeys@keyunknown@filtered       #1%       \let\pgfkeys@case@one=\pgfkeys@orig@case@one       \let\pgfkeys@try=\pgfkeys@orig@try       \let\pgfkeys@keyunknown=\pgfkeys@orig@unknown       \pgfkeysfilteringisactivefalse     }      Is the 'state' the following functions?               \pgfkeysfilteringisactive % boolean     \pgfkeys@case@one     \pgfkeys@case@one@filtered     \pgfkeys@try     \pgfkeys@try@filtered     \pgfkeys@keyunknown     \pgfkeys@keyunknown@filtered


title: Translator name in biblatex-chicago -- what am I doing wrong?

text: Been struggling with this for... too long. This (template I found) works:               \documentclass{article}     \usepackage[danish]{babel}     \usepackage[         backend=biber     ]{biblatex-chicago}     \DeclareLanguageMapping{danish}{cms-danish}     \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @Book{gardner1999,       title =        "Den intelligente skole",       subtitle =     "Gardner i praksis",       author =       "Howard Gardner",       date =         "1999",       usere =    "Multiple Intelligenses",       origdate =     "1993",       origpubliser = "FooPub",       origlocation = "USA",       publisher =    "Gyldendal",       origlanguage = "english",       edition =      "1",       translator =   "Strandberg, Kurt",       location =     "Kbenhavn",     }     \end{filecontents}          \addbibresource{\jobname.bib}          \DefineBibliographyStrings{danish}{           cbytranslator = {Oversataf}     }     \begin{document}     foo\footcite[1]{gardner1999}                         \nocite{*}     \printbibliography     \end{document}      My own file, on the other hand does not:               \documentclass{article}     \usepackage[danish]{babel}     %\usepackage[utf8]{inputenc}     \usepackage[backend=biber]{biblatex-chicago}     \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}               @Book{gardner1999,       title =        "Den intelligente skole",       subtitle =     "Gardner i praksis",       author =       "Howard Gardner",       date =         "1999",       usere =        "Multiple Intelligenses",       origdate =     "1993",       origlanguage = "english",       publisher =    "Gyldendal",       edition =      "1",       translator = "Strandberg, Kurt",       location =     "Kbenhavn",     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}     Foo\footcite[1]{gardner1999}     \newpage     \nocite{*} %% vis alt i bibliografien     \printbibliography %% Historian      \end{document}      It gives me the error:                Package biblatex Warning: Bibliography string 'cbytranslator' undefined     (biblatex)                at entry 'gardner1999' on input line 34.      and this ugly output: ![enter image description here](http://i.stack.imgur.com/iJ4GM.png) I can't seem to find out what's wrong -- I hope you guys can help!


title: Using \left( & \right) around amsmath's align delimiter ("&")

text: I want to align equations (using the `align` environment from the `amsmath` package) inside matching `\left(` and `\right)` commands. For example:               \documentclass[a4paper,12pt]{article}          \usepackage{amsmath}          \begin{document}          \begin{align}         a \left( b &= c \right)\\         d \left( e &= f \right)     \end{align}          \end{document}      But that code gives this error: > Extra }, or forgotten \right. The error disappears when I remove the delimiters. Is there a workaround for this?


title: Left/Right across multi-line equation

text: I have a multi-line equation that I want to have matching sized parentheses. The advice I read online was to use `\left( equation \right. \\\ left. rest- of-equation \right)` . However, this syntax leaves first half of the equation unaware of what is in the second half. For example, if you include a square root term after the break, the second parenthesis will be larger than the opening parenthesis. When you are using the `aligned` environment to split a long equation this can look somewhat offputting. ![alt text](http://i.stack.imgur.com/tyVeT.png) Compare the top equation to the bottom one. The parentheses match in size for the bottom equation, but the left hand parentheses for the top one is noticeably smaller. Top Code:                \begin{aligned}[t]       \gamma_{\text{u}} + \frac{1}{108}       \left(57\gamma_{\text{er}} \right. &+  38\gamma_{\text{se}}\\ & {}\pm      \left.\sqrt{2601 \gamma_{\text{er}}^2 + 3648      \gamma_{\text{er}}\gamma_{\text{se}} + 1444 \gamma_{\text{se}}^2}      \right)       \end{aligned}      Bottom Code:               \begin{aligned}[t] \gamma_{\text{u}} + \frac{1}{16}     \left(9\gamma_{\text{er}}  +  6\gamma_{\text{se}} \pm  \sqrt{49     \gamma_{\text{er}}^2 + 76 \gamma_{\text{er}}\gamma_{\text{se}} + 36     \gamma_{\text{se}}^2} \right) \end{aligned}


title: LaTeX parenthesis problem with multline environment

text: I have a problem with the different size of parenthesis with multiline (see image). Actually i don't care about the different size of the square parenthesis on `M` and `\bar{M}` but I really care about the round square one! I want the same size (and I don't wanna avoid `\left` and `\right` since I need the last parenthesis as big as the integral!). Some help? ![enter image description here](http://i.stack.imgur.com/I7yQW.png) Code:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{multline}     \left\lbrace q\left( t\right) \right\rbrace = \left[ \Phi \right] \left( \left[ C\left( t\right) \right] \left[ \bar{M}\right] \left[ \Phi\right]^{\textrm{T}}  \left[ M\right] \left\lbrace q_{0} \right\rbrace + \left[ \Omega\right]^{-1} \left[ S\left( t\right) \right] \left[ \bar{M}\right] \left[ \Phi\right]^{\textrm{T}}  \left[ M\right] \left\lbrace \dot{q}_{0} \right\rbrace + \right. \\     \left. \left[ \bar{M}\right] \left[ \Omega\right]^{-1}  \intop_{0}^{t}  \left[ S\left( t-\tau \right) \right] \left[ \Phi\right]^{\textrm{T}}  \left\lbrace e \left( \tau\right) \right\rbrace d\tau  \right) .     \end{multline}     \end{document}


title: Why Latex cannot compile when I add "\left[ ]\right"

text: **_Successful code:_**               \documentclass[a4paper,cs4size,UTF8]{ctexart}                             \usepackage{amsmath}                      \usepackage{mathtools}     \usepackage{amssymb}     \begin{document}     \end{document}     \begin{equation}     \begin{split}     & L_1=\frac{1}{2} Trace     \left[     \sum_{i=1}^{n}\sum_{p=1}^{i} (U_{ip}J_iU_{i1})\dot{q}_p\dot{q}_1 +\dots +     (U_{ip}J_iU_{it})\dot{q}_t \dot{q}_2+\dots +(U_{ip}J_iU_{ii})\dot{q}_p\dot{q}_i)      \right]\\     & \quad =\frac{1}{2} Trace [\sum_{i=1}^{n} \\     &  (U_{i1}J_iU_{i1})\dot{q}_1\dot{q}_1 +\dots +(U_{i1}J_iU_{it})\dot{q}_1  \dot{q}_t+\dots +(U_{i1}J_iU_{ii})\dot{q}_1\dot{q}_i \\     & +(U_{i2}J_iU_{i1})\dot{q}_2\dot{q}_1 +\dots +(U_{ip}J_iU_{it})\dot{q}_2 \dot{q}_t+\dots +(U_{i2}J_iU_{ii})\dot{q}_2\dot{q}_i \\     & + \qquad \vdots \qquad \quad  +\qquad \qquad \vdots \qquad \qquad \quad +\qquad \qquad \vdots \\     & +(U_{ii}J_iU_{i1})\dot{q}_i\dot{q}_1 +\dots +(U_{ii}J_iU_{it})\dot{q}_t \dot{q}_2+\dots +t(U_{ii}J_iU_{ii})\dot{q}_i\dot{q}_i  ]     \end{split}     \end{equation}     \end{document}      However,when I add `\left[ ]\right`               \documentclass[a4paper,cs4size,UTF8]{ctexart}                             \usepackage{amsmath}                      \usepackage{mathtools}     \usepackage{amssymb}     \begin{document}          \begin{equation}     \begin{split}     & L_1=\frac{1}{2} Trace     \left[     \sum_{i=1}^{n}\sum_{p=1}^{i} (U_{ip}J_iU_{i1})\dot{q}_p\dot{q}_1 +\dots +     (U_{ip}J_iU_{it})\dot{q}_t \dot{q}_2+\dots +(U_{ip}J_iU_{ii})\dot{q}_p\dot{q}_i)      \right]\\     & \quad =\frac{1}{2} Trace \left[\sum_{i=1}^{n} \\     &  (U_{i1}J_iU_{i1})\dot{q}_1\dot{q}_1 +\dots +(U_{i1}J_iU_{it})\dot{q}_1  \dot{q}_t+\dots +(U_{i1}J_iU_{ii})\dot{q}_1\dot{q}_i \\     & +(U_{i2}J_iU_{i1})\dot{q}_2\dot{q}_1 +\dots +(U_{ip}J_iU_{it})\dot{q}_2 \dot{q}_t+\dots +(U_{i2}J_iU_{ii})\dot{q}_2\dot{q}_i \\     & + \qquad \vdots \qquad \quad  +\qquad \qquad \vdots \qquad \qquad \quad +\qquad \qquad \vdots \\     & +(U_{ii}J_iU_{i1})\dot{q}_i\dot{q}_1 +\dots +(U_{ii}J_iU_{it})\dot{q}_t \dot{q}_2+\dots +t(U_{ii}J_iU_{ii})\dot{q}_i\dot{q}_i  \right]     \end{split}     \end{equation}     \end{document}      **_It failed,So my question is how to resolve this problem._**


title: Brackets in two different align "lines"

text: i want to use a big bracket (\left( , \right)) in an align-enviroment over two lines, so that               \begin{align}     0=\left(a+b+c \\       +d+e\right)     \end{align}      which is not possible, because Latex want me to close the bracket in the same line. Anyone an idea? Greetings Michael


title: A way of handling \left and \right brackets

text: I'm looking a way of making something like this:               \underbrace{         \left[\nabla\times         \left[\nabla\times         \left[\ldots\nabla\times     }_{         \infty\text{-times taking curl operator}     }         \mathbf{V}\right]\right]\ldots\right] = ?


title: Big Parenthesis in different lines

text: I am trying to type two or three lines using big parenthesis inserting some sentences. I am using this but it does not work for me.               \documentclass{12 pt}{article}           \begin{document}          \begin{eqnarray}     & & (product of (A\times_{c} B) by C)\nonumber\\     & &\times_{c}  D) by E.     \end{eqnarray}          \end{document}       I want to use the parenthesis are big not the small usual one.


title: Splitting equations with parentheses in aligned

text: How can I break the first line               \begin{equation}     \begin{aligned}[2]     & some stuff \left\{ stuff' + stuff'' \right\} \\     & = some other stuff     \end{aligned}     \end{equation}      in a way such that the following graphical output is obtained               stuff { ...            + ... }     = some other stuff      for the graph parentheses, using `\right.` etc.?


title: Use of parenthesis/curly bracket in split environment: Error for curly bracket on opposite sides of \\

text: Any help is most appreciated. Thanks!               \documentclass{article}     \usepackage{amsmath}     \usepackage{mathtool}     \begin{document}     \begin{align}     \begin{split}     & v \cdot \left\{ Ax + b \\     & Cx - d \right\}     \end{split}     \end{align}     \end{document}


title: \left and \right in equation across multiple lines

text: > **Possible Duplicate:**   >  Left/Right across multiline equation Could someone explain why I can't get the `left` and `right` commands to work correctly **code:**               \documentclass{article}     \usepackage{amsmath}     \begin{document}          \begin{equation}     \begin{align}     \label{eq:foo}     s_{i}^{G}= & \min     \left     (        \sqrt        {\           \min           (               (                 x_{i}^{G}-x              )                 ^2,               (                 w_{T} - x_{i}^{G}-x              )                 ^2             )            +               y        }        ,\\        &         \sqrt        {\           \min           (               (                 x_{i}^{G}-x              )                 ^2,               (                 w_{T} - x_{i}^{G}-x              )                 ^2             )            +            \min            (               (                 y_{i}^{G}-y              )                 ^2,               (                 h_{T} - y_{i}^{G}-y              )                 ^2           )        }      \right     )     \end{align}     \end{equation}          \end{document}


title: error when breaking equation over two lines

text: I'm trying to write a long equation which will need to be split over two lines. I', using various suggestions found on this site but they all seem to give an error, the error being that I'm missing \right inserted at the end of the equation. This clearly isn't the case as the original form of the equation i.e. without splitting over two lines works perfectly.               \documentclass{article}     \usepackage{amsmath}          \begin{document}          \begin{align}     u_{*} = \kappa{U_{z}}\left[\left[\ln\left(\frac{\zeta_{m}L}{z_{o}}\right) - \psi_{m}\left(\zeta_{m}\right)\right] + 1.14\left[\left(-\zeta\right)^{1/3} - \left(-\zeta\right)^{1/3}\right] + \psi_{m}\left(\frac{z_{o}}{L}\right)\right]     \end{align}          \begin{multline}     u_{*} = \kappa{U_{z}}\left[\left[\ln\left(\frac{\zeta_{m}L}{z_{o}}\right) - \psi_{m}\left(\zeta_{m}\right)\right] \\     + 1.14\left[\left(-\zeta\right)^{1/3} - \left(-\zeta\right)^{1/3}\right] + \psi_{m}\left(\frac{z_{o}}{L}\right)\right]     \end{multline}          \begin{align}     u_{*} &= \kappa{U_{z}}\left[\left[\ln\left(\frac{\zeta_{m}L}{z_{o}}\right) - \psi_{m}\left(\zeta_{m}\right)\right]\\     &+ 1.14\left[\left(-\zeta\right)^{1/3} - \left(-\zeta\right)^{1/3}\right] + \psi_{m}\left(\frac{z_{o}}{L}\right)\right]     \end{align}          \end{document}      where am I going wrong?


I tried to fix this problem by reading the answers to the questions on this forum related to this topic, but I did not find any solution. Could you help me, please? The thing is that I have to break a long equation with an initial bracket...Because of that, I am not able to use neither split nor align...Here the text               \begin{equation}     u_{i}^{n+1} = \frac{1}{2} \hat u_m^n e^{Ii\phi_m} \left\{ \frac{1}{2} \left(e^{I\phi_m}+e^{-I\phi_m}+2\right)      -\frac{\Gamma}{2} \left(e^{I\phi_m} + e^{-I\phi_m}\right) - \Gamma \left[ \frac{1}{2} \left(e^{I\phi_m} + e^{-I\phi_m}\right) - \frac{\Gamma}{2} \left(e^{I\phi_m} + e^{-I\phi_m} -2\right)\right] \right\}. \notag     \end{equation}


title: Aligned and \left \right

text: The following aligned equation gives an error 'Extra }, or forgotten \right.':               \begin{equation}     \begin{aligned}     U&=\mathbb{R}^{M N}\\     V&=\mathbb{R}^{2 M N}\\     W&=\mathbb{R}^{4 M N}\\     \min_{v\in V} \left\{E_p(v)&=\|\nabla v\|_{W,1}+\lambda \|\rho(v)\|_{U,1} \right\}     \end{aligned}     \end{equation}      Removing the `\left` and `\right` commands avoids the error:               \begin{equation}     \begin{aligned}     U&=\mathbb{R}^{M N}\\     V&=\mathbb{R}^{2 M N}\\     W&=\mathbb{R}^{4 M N}\\     \min_{v\in V} \{E_p(v)&=\|\nabla v\|_{W,1}+\lambda \|\rho(v)\|_{U,1} \}     \end{aligned}     \end{equation}      I don't understand why having the alignment marker inside a `\left` `\right` command is an error. How do I align an equation with the alignment inside a `\left` `\right` command?


title: Error using split within an equation

text: I am getting multiple errors for using `split` within an equation. I use this command in a number of other places throughout my LaTeX document, but there is one case in which many errors are given saying either:               missing } inserted, \end{split}     missing \right, inserted \end{split}     extra }, or forgotten \right \end{split}      etc.. There is 12 total errors, some of which repeat, all for this one `\end{split}` occasion. MWE:               \documentclass{article}     \usepackage{amsmath}          \begin{document}               \begin{equation}     \begin{split}     \label{eq:FullRate}             W_{full} = \dfrac{2\omega}{9\pi}\left(\dfrac{\sqrt{1+\gamma^2}}{\gamma}\dfrac{m_e\omega}{\hbar}\right)^{3/2}Q\left(\gamma,\dfrac{E_g^*}{\hbar\omega}\right)\:\times\:exp\left\lbrace-\pi\left(\dfrac{E_g^*}{\hbar\omega}+1\right) \\ \times\:\left[K\left(\dfrac{\gamma}{\sqrt{1+\gamma^2}}\right)-E\left(\dfrac{\gamma}{\sqrt{1+\gamma^2}}\right)\right]/E\left(\dfrac{1}{\sqrt{1+\gamma^2}}\right)\right\rbrace     \end{split}     \end{equation}          \end{document}      I apologize for the lengthy equation. Everything compiles normally without the split command inserted. Any ideas why this is causing an error? I've looked through it a hundred times trying to figure out if I left something out but everything seems to be in the right place. Thank you for any and all help!


title: Multiline equations within parentheses

text: I have two equations which need to be broken into multiple lines. One of the equations has a coeficiente factored out, so that it is of the form X = A(...very long...). The other does not. The equations were written as               $\!\begin{aligned}          y &= \frac{1}{A}\left(\frac{b_1\cdot{}t_{f1}^2}{2}+h_w\cdot{}t_w\left(t_{f1}+\frac{h_w}{2}\right)+\right.\\         &\phantom{=}\left.+b_2\cdot{}t_{f2}\left(t_{f1}+h_w+\frac{t_{f2}}{2}\right)\right)\\         I_y &= \dfrac{1}{12}\left(b_1\cdot{}t_{f1}^3+t_w\cdot{}h_w^3+b_2\cdot{}t_{f2}^3\right)+\\         &\phantom{=}+b_1\cdot{}t_{f1}\left(y-\dfrac{t_{f1}}{2}\right)^2+\\     \end{aligned}$      The use of `$\\!\begin{aligned}` instead of a standard `align` environment is because this is contained within a table. This results in the following output: ![Equations](http://i.stack.imgur.com/4pzfE.png) This is fine and is as expected. However, the global parentheses in the first equation required the use of `\right.` and `\left.` at the end of the first line and beginning of the second line, which seems to eat the space between the `+` and `b`, as becomes clear when you compare the space between them in the first and second equations. This is a purely aesthetic issue, but I'm curious to know if it is (preferably trivially) solved.


title: How can I position the tag of a "nested" aligned environment?

text: I have an equation that is two wide to fit on a single line, but it has `\left(`-`\right)` split over two lines, and I can't align to something inside these for some reason... The wanted output is something like this:               A = B ( C             + D ) (1)      The best I can do is this:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{equation}      A =      \begin{aligned}[t]       &\left( B \right. \\       &\phantom{(} \left. + C \right)      \end{aligned}      %\raisetag{-1\baselineskip} <- doesn't work :-(     \end{equation}     \end{document}      But this places the equation number on the top line, which looks very awkward when the horizontal spacing is a lot more compact than in this isolated example. What magic ritual do I need to perform for the proper layout of this equation?


title: How can I change the low, med, high penalty settings for \linebreak? Or perhaps there's better way of breaking lines?

text: This question really belongs as a comment to Applications of various strength of \linebreak command but unfortunately my reputation is so low that I'm not allowed to comment. http://tex.stackexchange.com/users/1090/david-carlisle has very helpfully explained that that the reason why the various optional settings for \linebreak don't work very well is because the values of low, med, and highpenalty are "a bit odd". I would use a less charitable term, personally. In particular, linebreak[3] assigns a penalty of 301 out of 10000, which presumably explains why it is so ineffectual. I would like to change these settings to the values that would seem obviously more sensible, e.g., spread them evenly between 0 and 10000. Is this possible? Why do I care? I'm extremely puzzled that the consensus is that use of linebreak options should be extremely rare. For me, if it worked properly, I'd be using it all the time. The reason is that I want to avoid breaking up possibly long inline math displays, and would like, ideally, to have linebreak decide to insert a linebreak, fill the preceding line and put the entire math display (enclosed in an \mbox to prevent breaking it up) on the beginning of the next line if and only if the math display, if left on the preceding line, would run beyond the regular right margin. Perhaps there's a better way than linebreak of accomplishing what I need?


title: Beamer-Generated slides to PPT?

text: I like creating slides in Beamer. My supervisor doesn't. He wants me to "generate or convert [the set I did for a conference] to PowerPoint." I've tried different online and offline products like `Okto all to PowerPoint', TotalPDFConverter, and free-pdf-to-ppt-converter, but none of them quite cut it. Most will screw up the text and/or the graphics, or simply convert the whole thing into a number of (low-resolution) bitmaps which are included in a PPT. The best results I get with pdf2picture, which can convert PDFs into WMF or EWMF files which can be inserted into PPT slides. When converting text to curves, most of the graphics look ok, however transparency doesn't seem to be handled correctly and it's still a lot of work inserting one WMF after another. It says here that going through Keynote seems to work, but I'm already using PPT in a VM inside Linux---bringing in another OS would really be overkill. Does anyone have any other hints? The result should look like the original PDF and it should be editable, but it's alright if for example text is converted to curves or so.


title: Definition environment versus utf8

text: I had some problems with my code, then I changed to               \usepackage[utf8]{inputenc}      and I could compile. But now I have another problem. I write in Brazilian portuguese, so the definition environment compiles in Portuguese, I mean, in the document we see "Definição" (Definition in portuguese). So, when I try to compile, I have this message:               Package inputenc Error: Unicode char \u8:ção not set up for use with LaTeX      What can I do? PS: I don'k know if it helps, but I use also these packages:               \usepackage[brazilian]{babel}     \usepackage[T1]{fontenc}      Thanks :D The minimal I could do hahaha: The main file:               \documentclass[11pt,fleqn]{book}          \usepackage{microtype}     \usepackage[utf8]{inputenc}     \usepackage[brazilian]{babel}     \usepackage[T1]{fontenc}          \usepackage{xcolor}     \definecolor{ocre}{RGB}{243,102,25}          \input{structure}          \begin{document}          \begin{definition}       Um triângulo é um polígono de 3 lados.     \end{definition}          \end{document}       And the structure input file:               \usepackage{titlesec} % Allows customization of titles          \usepackage{graphicx} % Required for including pictures     \graphicspath{{Pictures/}} % Specifies the directory where pictures are stored          \usepackage{amsmath,amsfonts,amssymb,amsthm} % For including math equations, theorems, symbols, etc          \newtheorem{definitionT}{Definição}[section]          \RequirePackage[framemethod=default]{mdframed} % Required for creating the theorem, definition, exercise and corollary boxes          % Theorem box     \newmdenv[skipabove=7pt,     skipbelow=7pt,     backgroundcolor=black!5,     linecolor=ocre,     innerleftmargin=5pt,     innerrightmargin=5pt,     innertopmargin=5pt,     leftmargin=0cm,     rightmargin=0cm,     innerbottommargin=5pt]{tBox}          \newenvironment{definition}{\begin{tBox}\begin{definitionT}}{\end{definitionT}\end{tBox}}         Thanks :)


title: Converting MS Office documents (DOC&DOCX) into LaTeX by w2l in command lines of linux

text: I want to convert `MS Office` documents(DOC&DOCX) into `LaTeX`! I need to do two steps to finish the conversion. The first step is to convert the MS Office documents into `libreoffice(ODT)` by `libreoffice4.2 odt:"writer8" *.DOCX`. The second step is to convert `libreoffice(ODT)` into `LaTeX` by `w2l -config writer2latex.xml *.odt`, which uses command `xetex` and this command support Chinese. Actually I am able to finish the first step but I face some problems in the second step. the formulas inputted by Mathtype and images have been converted the format of .svm, which can be opened in `libreoffice(ODT)`. However, the `LaTeX` can't recognize `.svm`, which drives me crazy. PS:This step is finished successfully. In the second step, if I open ODT produced in the first step in `libreoffice(ODT)` and export `.tex` using `writer2latex extension`, then the formulas inputted by Mathtype and images have been converted the format of .pdf, which can be recognized by `LaTeX`. The `.tex` can be compiled using `xetex *.tex`. All the operations are executed in the environment of `debian 7.5 , texlive2013`.


title: Show clock in beamer presentation

text: Is there any possibility to add a `clock` to be shown in each slide using `beamer`?


title: Set colour of equations when using preview package

text: I use the preview package to export a pdf containing only my equations by putting the following in the preamble               \usepackage[active,tightpage,displaymath,textmath]{preview}     \setlength\PreviewBorder{2pt}     \PreviewEnvironment{equation*}     \makeatletter\renewcommand\@eqnnum{}\makeatother      I would like to set the colour of the exported equations. How can I specify the colour such that the preview package will see it?


title: XML syntax highlighting

text: I use the following code to include some XML code:               \lstset{language=XML}     \begin{lstlisting}     <?xml version="1.0" encoding="utf-8"?>     <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"        xmlns:xs="http://www.w3.org/2001/XMLSchema">       <xs:element name="points">         <xs:complexType>           <xs:sequence>             <xs:element maxOccurs="unbounded" name="point">               <xs:complexType>                 <xs:attribute name="x" type="xs:unsignedShort" use="required" />                 <xs:attribute name="y" type="xs:unsignedShort" use="required" />               </xs:complexType>             </xs:element>           </xs:sequence>         </xs:complexType>       </xs:element>     </xs:schema>     \end{lstlisting}      But only `?xml version` is highlighted. Is there any other predefined XML syntax highlighting?


title: BeamerArticle and \\

text: I am trying to use `beamer` and `beamerarticle` to generate slides and accompanying notes. I noticed that the latex command `\\\` to start a new paragraph does not seem to work in the `beamerarticle` mode. Here is a minimal reproducible example. You will notice on compilation to pdf, that both sentences are printed on the same line. Any thoughts on why this is happening, and if there is a way to overcome this behavior?               \documentclass{article}     \usepackage{beamerarticle}          \begin{document}          \frame{\frametitle{Some Slide}     \noindent this is good \\ this is bad     }          \end{document}


title: Rare pdflatex "Auto Expansion is only possible with scalable font" on scaleable-font document

text: I know I am sounding crazy, but this looks like a veritable pdflatex bug to me. even small innocent changes to the file make it go away.               \documentclass[12pt]{article}          \usepackage[english]{babel}  %% hyphenation and other small changes     \RequirePackage[T1]{fontenc} %% hyphenation of accented words, copy-paste pdf output, pipe sign, less than ,etc.     \RequirePackage{charter} %% the main font, scaleable     \usepackage{microtype}  %% should always be the default          \newcommand{\textxsmally}[1]{#1}     \newcommand{\lmc}[1]{$\backslash$#1}          \begin{document}          \lmc{textbf} (\textbf{bold}) an \lmc{textsf} (\textsf{sans-serif}), and define \lmc{textxsmall} (\textxsmally{anything}).          \end{document}      just removing even some obviously innocent characters in the text, and, poof, it is gone. this is under               pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)     kpathsea version 6.1.1     Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     There is NO warranty.  Redistribution of this software is     covered by the terms of both the pdfTeX copyright and     the Lesser GNU General Public License.     For more information about these matters, see the file     named COPYING and the pdfTeX source.     Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     Compiled with libpng 1.2.49; using libpng 1.2.49     Compiled with zlib 1.2.8; using zlib 1.2.8     Compiled with poppler version 0.24.1      and it only rears its head under pdflatex, not under latex (which is of course also pdftex). is there something wrong with my install or can this be replicated elsewhere? * * * UPDATE: This is a little more interesting. If you look at the example above, realize that I did not (want to) use the computer modern fonts, but charter fonts, which are scaleable. One way to eliminate the bug is to remove the microtype, which apparently is doing font expansion (whatever this may be). Searching the log file for **pk** tells me the culprit: fonts/pk/ljfour/jknappen/ec/ecss1200.600pk. I did not realize that we were even using them. pdffonts tells me               $ pdffonts ...pdf     name                                 type              encoding         emb sub uni object ID     ------------------------------------ ----------------- ---------------- --- --- --- ---------     HAJUBM+CMSY10                        Type 1            Builtin          yes yes no       4  0     CZKSHZ+CharterBT-Roman               Type 1            Custom           yes yes no       5  0     KMKFIH+CharterBT-Bold                Type 1            Custom           yes yes no       6  0     [none]                               Type 3            Custom           yes no  no       7  0      hmmm...maybe the first font is the problem. I did not believe that any CMS fonts were still being used, once I usepackage{charter}. but I was mistaken. obviously CMSY10 is still there, as is some unidentified Type-3 font. so, I need to get rid of bitmap CMR fonts, even though I do not want to use them. I can do so by including package lmodern before package charter, even though I do not believe any of its fonts are actually used. So, this worked for me:               \documentclass[12pt]{article}          \usepackage[english]{babel}  %% hyphenation and other small changes     \usepackage[T1]{fontenc} %% hyphenation of accented words, copy-paste pdf output, pipe sign, less than ,etc.     \usepackage{lmodern}     \usepackage{charter} %% the main font, scaleable     \usepackage{microtype}  %% should always be the default          \newcommand{\textxsmally}[1]{#1}     \newcommand{\lmc}[1]{$\backslash$#1}          \begin{document}          \lmc{textbf} (\textbf{bold}) an \lmc{textsf} (\textsf{sans-serif}), and define \lmc{textxsmall} (\textxsmally{anything}).          \end{document}      and the resulting font output is               name                                 type              encoding         emb sub uni object ID     ------------------------------------ ----------------- ---------------- --- --- --- ---------     CQLPTE+LMMathSymbols10-Regular       Type 1            Custom           yes yes no       4  0     CZKSHZ+CharterBT-Roman               Type 1            Custom           yes yes no       5  0     KMKFIH+CharterBT-Bold                Type 1            Custom           yes yes no       6  0     OHZRNJ+LMSans12-Regular              Type 1            Custom           yes yes no       7  0      hope this helps some other hapless soul(s). /iaw


title: Cyrillic and microtype: pdfTeX error (font expansion): auto expansion is only possible with scalable fonts

text: I have a rather huge document and everything worked fine. The problems started when I tried to insert some Russian text. I was able to resolve some issues, but now I'm stuck with the following error:               ! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts.      It was really hard to produce a MWE, but it looks like it has something to do with `microtype` package. I don't fully understand what it does, but it's part of the template, so I'd like to keep it. Here comes the MWE:               \documentclass{article}     \usepackage[T2A, T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[russian,english]{babel}     \usepackage[protrusion=true,factor=900]{microtype}          \newcommand{\ru}[1]{{\begin{otherlanguage*}{russian} #1 \end{otherlanguage*}}}          \begin{document}          Here is a Russian text:     \ru{Здравствуйте! Как у вас дела? Меня зовут Калеб. Как вас зовут?}          \end{document}      I've introduced the `\ru` command for convenience. However, it also produces the error without this command. But if somebody wants to suggest a good way of inserting text in a different language - feel free :). **Edit 1** Added `\usepackage[T2A, T1]{fontenc}`, added missing part of error message. I'm using TeX Live from Ubuntu 12.10: `pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)`


title: Change figure caption name in "thesis" document

text: Does anyone have an idea why this approach to changing figure naming doesn't work in _thesis_ type document? I'm using babel and all other captions translate normally, except "Figure", which stays at "Fig." no matter what I do. I've tried to change it using _renewcommand_ macro but it does not work:               \documentclass[12pt,a4paper,twoside,openright]{thesis}     \usepackage{graphicx}     \usepackage[slovene]{babel}          \addto\captionsslovene{\renewcommand{\figurename}{Slika}}          \begin{document}          \begin{figure}     \centering     \includegraphics[scale=1]{picture.png}     \caption{Random caption}     \end{figure}          \end{document}      If I switch to _book_ document type it works as expected, but I would really like to keep this document in the _thesis_ format to make use of all the good stuff that enables me to format my work properly.


title: Integral operator does not compile

text: When I put `\int` on LyX it doesn't compile. I had tried to refresh and update and nothing works. It throws me this error: > >     Font\U/esint/m/n/12=esint10 at 12pt not loadable: metric data not found > or bad. >     Font\U/esint/m/n/8=esint10 at 8pt not loadable: metric data not found or > bad. >     Font\U/esint/m/n/6=esint10 at 6pt not loadable: metric data not found or > bad. >     \textfont6 is undefined (character 1). >     \textfont6 is undefined (character 1). >     \textfont6 is undefined (character 1). >     \textfont6 is undefined (character 1). >   Please I need help! I need to finish my homework today :(


title: Object Formatting: Graphics as In-line Symbols

text: I'm trying to create an in-line symbol that is a specific shape. I'm wondering how I can have something like this in my document: ![enter image description here](http://i.stack.imgur.com/zuHrS.jpg)