title: Complex longtable with multirow, multicolumn, rotation of text, and a strange header

text: I want do a table like the next figures 1 and 2. The table go expand in many pages. The header is the same in all of them, and I want put the elements A, B and C in the headers of the tables, because they repeat and I have many tables to do and because it's logical. The rows D are variable, in quantity and arrange, as you see. I have made the next code, wrong, as you are seeing (figures 3 and 4): \- wrong height of the rows (must be auto adjust) \- the last column must be with two lines \- and so on... Please, help me :) ![Figure 1](http://i.stack.imgur.com/i1gRH.png) ![Figure 2](http://i.stack.imgur.com/UdlmT.png) ![Figure 3](http://i.stack.imgur.com/nOC7k.png) ![Figure 4](http://i.stack.imgur.com/CET5t.png)                   % XeTeX          \documentclass[12pt,a4paper,oneside]{article}          \usepackage{xunicode}     \usepackage{xltxtra}     \usepackage{fontspec}     \usepackage{polyglossia}     \setdefaultlanguage{portuges}     \usepackage[bookmarks=true,       citecolor=black,       filecolor=black,       linkcolor=black,       urlcolor=black,       unicode=false,       colorlinks=false,       plainpages=false,       pdfpagelabels,       colorlinks=true,       xetex]{hyperref}     \usepackage{longtable}     \usepackage{multirow}     \usepackage{lscape}          \begin{document}          \begin{landscape}\noindent     \small     \begin{longtable}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}     \hline     \multicolumn{ 16}{|c|}{PLANO DE ACÇÃO} \\ \hline     \multicolumn{ 7}{|c|}{Elementos do plano de acção} &      \multicolumn{ 8}{c|}{Temas} &      \multicolumn{ 1}{c|}{\multirow{3}{*}{\rotatebox{90}{Avaliação}}} \\ \cline{1- 15}          \multirow{2}{*}{\rotatebox{90}{Diagnóstico}} &      \multirow{2}{*}{\rotatebox{90}{Objectivos}} &      \multirow{2}{*}{\rotatebox{90}{Metas}} &      \multirow{2}{*}{\begin{minipage}[c][16ex][c]{40ex}\centering Acções Previstas\end{minipage}} &      \multicolumn{3}{c|}{\begin{minipage}[c][14ex][c]{3cm}Concretização\end{minipage}} &      \multirow{2}{*}{\rotatebox{90}{Água}} &      \multirow{2}{*}{\rotatebox{90}{Resíduos}} &      \multirow{2}{*}{\rotatebox{90}{Energia}} &      \multirow{2}{*}{\rotatebox{90}{Espaços Exteriores}} &      \multirow{2}{*}{\rotatebox{90}{Agricultura Biológica}} &      \multirow{2}{*}{\rotatebox{90}{Mar}} &      \multirow{2}{*}{\rotatebox{90}{Biodiversidade}} &      \multirow{2}{*}{\rotatebox{90}{Alterações Climáticas}} &       \\\cline{ 5- 7}           &       &       &       &      \multicolumn{ 1}{c|}{\begin{minipage}[c][14ex][c]{14ex}\centering Recursos\end{minipage}} &      \multicolumn{ 1}{c|}{\begin{minipage}[c][14ex][c]{14ex}\centering Intervenientes\end{minipage}} &      \multicolumn{ 1}{c|}{\begin{minipage}[c][14ex][c]{14ex}\centering Calendarização\end{minipage}} &       &       &       &       &       &       &       &       &       \\ \hline          \endfirsthead          \hline     \multicolumn{ 16}{|c|}{PLANO DE ACÇÃO} \\ \hline     \multicolumn{ 7}{|c|}{Elementos do plano de acção} &      \multicolumn{ 8}{c|}{Temas} &      \multicolumn{ 1}{c|}{\multirow{3}{*}{\rotatebox{90}{Avaliação}}} \\ \cline{ 1- 15}          \multirow{2}{*}{\rotatebox{90}{Diagnóstico}} &      \multirow{2}{*}{\rotatebox{90}{Objectivos}} &      \multirow{2}{*}{\rotatebox{90}{Metas}} &      \multirow{2}{*}{\begin{minipage}[c][16ex][c]{40ex}\centering Acções Previstas\end{minipage}} &      \multicolumn{3}{c|}{\begin{minipage}[c][14ex][c]{3cm}Concretização\end{minipage}} &      \multirow{2}{*}{\rotatebox{90}{Água}} &      \multirow{2}{*}{\rotatebox{90}{Resíduos}} &      \multirow{2}{*}{\rotatebox{90}{Energia}} &      \multirow{2}{*}{\rotatebox{90}{Espaços Exteriores}} &      \multirow{2}{*}{\rotatebox{90}{Agricultura Biológica}} &      \multirow{2}{*}{\rotatebox{90}{Mar}} &      \multirow{2}{*}{\rotatebox{90}{Biodiversidade}} &      \multirow{2}{*}{\rotatebox{90}{Alterações Climáticas}} &       \\\cline{ 5- 7}           &       &       &       &      \multicolumn{ 1}{c|}{\begin{minipage}[c][14ex][c]{14ex}\centering Recursos\end{minipage}} &      \multicolumn{ 1}{c|}{\begin{minipage}[c][14ex][c]{14ex}\centering Intervenientes\end{minipage}} &      \multicolumn{ 1}{c|}{\begin{minipage}[c][14ex][c]{14ex}\centering Calendarização\end{minipage}} &       &       &       &       &       &       &       &       &       \\ \cline{ 4-12}          \endhead          \hline     \multicolumn{16}{r}{\emph{Contínua na página seguinte\dots}}     \endfoot     % Nada na última     \hline     \endlastfoot           &       &       &      \begin{minipage}[c][18ex][c]{40ex}Sensibilização dos alunos, em contexto de sala, e numa perspectiva de transdisciplinaridade para a necessidade de reduzir ao máximo o consumo de água no Internato.\end{minipage} &      \begin{minipage}[c][14ex][c]{14ex}\centering Materiais didáticos diversos\par Ex: DVD “Diz o Alberto”. \end{minipage} &      \begin{minipage}[c][14ex][c]{14ex}\centering Corpo de Alunos e Professores de todas as disciplinas. \end{minipage} &      \begin{minipage}[c][14ex][c]{14ex}\centering 1.º, 2.º e 3.º Períodos \end{minipage} &       $\times$&       &       &       &       &       &       &       & \multirow{3}{*}{\rotatebox{90}{Observação de comportamentos. Registo dos consumos.}}     \\ \cline{ 4-15}           &       &       &      \begin{minipage}[c][10ex][c]{40ex}Medição sectorial do consumo de água no Internato.\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Contadores\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering IPE\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering 1.º, 2.º e 3.º Períodos\end{minipage} &       $\times$&       &       &       &       &       &       &       &      \\ \cline{ 4-15}           &       &       &      \begin{minipage}[c][10ex][c]{40ex}Monitorização diária dos consumos de água.\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Contadores\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Alunos e Militar responsável.\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering 1.º, 2.º e 3.º Períodos\end{minipage} &       $\times$&       &       &       &       &       &       &       &      \\ \cline{ 4-16}           &       &       &      \begin{minipage}[c][10ex][c]{40ex} Aproveitamento das águas pluviais para rega do canteiro destinado à Agricultura Biológica\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Bidões e mangueiras usadas\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Militares, alunos e professores.\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering 1.º, 2.º e 3.º Períodos\end{minipage} &       $\times$&       &       &       &       &       &       &       & \multirow{0}{*}{\rotatebox{90}{Registo fotográfico.}}     \\          \end{longtable}     \end{landscape}     \end{document}      doing like David Carlisle in Vertical lines in a multirow and multicolumn table i have this table:               % XeLaTeX          \documentclass[12pt,a4paper,oneside]{article}          \usepackage{xunicode}     \usepackage{xltxtra}     \usepackage{fontspec}     \usepackage{polyglossia}     \setdefaultlanguage{portuges}     \usepackage[bookmarks=true,       citecolor=black,       filecolor=black,       linkcolor=black,       urlcolor=black,       unicode=false,       colorlinks=false,       plainpages=false,       pdfpagelabels,       colorlinks=true,       xetex]{hyperref}     \usepackage{longtable}     \usepackage{multirow}     \usepackage{lscape}     \usepackage{booktabs}     \usepackage{array}     \usepackage{rotating}          \begin{document}          \begin{landscape}\noindent     \small     \begin{longtable}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}     \toprule     \multicolumn{ 16}{|c|}{PLANO DE ACÇÃO} \\ \midrule     \multicolumn{ 7}{|c|}{Elementos do plano de acção} &      \multicolumn{ 8}{c|}{Temas} &      \multicolumn{ 1}{c|}{\multirow{3}{*}{\begin{sideways}\centering Avaliação\end{sideways}}} \\ \cmidrule{1- 15}     %     \multirow{2}{*}{\begin{sideways}Diagnóstico\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Objectivos\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Metas\end{sideways}} &      \multirow{2}{*}{\centering Acções Previstas} &      \multicolumn{3}{c|}{Concretização} &      \multirow{2}{*}{\begin{sideways}Água\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Resíduos\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Energia\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Espaços Exteriores\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Agricultura Biológica\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Mar\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Biodiversidade\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Alterações Climáticas\end{sideways}} &       \\\cmidrule{ 5- 7}           &       &       &       &      \multicolumn{ 1}{c|}{\centering Recursos} &      \multicolumn{ 1}{c|}{\centering Intervenientes} &      \multicolumn{ 1}{c|}{\centering Calendarização} &       &       &       &       &       &       &       &       &       \\ \midrule          \endfirsthead          \toprule     \multicolumn{ 16}{|c|}{PLANO DE ACÇÃO} \\ \midrule     \multicolumn{ 7}{|c|}{Elementos do plano de acção} &      \multicolumn{ 8}{c|}{Temas} &      \multicolumn{ 1}{c|}{\multirow{3}{*}{\begin{sideways}\centering Avaliação\end{sideways}}} \\ \cmidrule{1- 15}     %     \multirow{2}{*}{\begin{sideways}Diagnóstico\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Objectivos\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Metas\end{sideways}} &      \multirow{2}{*}{\centering Acções Previstas} &      \multicolumn{3}{c|}{Concretização} &      \multirow{2}{*}{\begin{sideways}Água\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Resíduos\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Energia\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Espaços Exteriores\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Agricultura Biológica\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Mar\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Biodiversidade\end{sideways}} &      \multirow{2}{*}{\begin{sideways}Alterações Climáticas\end{sideways}} &       \\\cmidrule{ 5- 7}           &       &       &       &      \multicolumn{ 1}{c|}{\centering Recursos} &      \multicolumn{ 1}{c|}{\centering Intervenientes} &      \multicolumn{ 1}{c|}{\centering Calendarização} &       &       &       &       &       &       &       &       &       \\ \cline{ 4-12}          \endhead          \hline     \multicolumn{16}{r}{\emph{Contínua na página seguinte\dots}}     \endfoot     % Nada na última     \hline     \endlastfoot           &       &       &      \begin{minipage}[c][18ex][c]{40ex}Sensibilização dos alunos, em contexto de sala, e numa perspectiva de transdisciplinaridade para a necessidade de reduzir ao máximo o consumo de água no Internato.\end{minipage} &      \begin{minipage}[c][14ex][c]{14ex}\centering Materiais didáticos diversos\par Ex: DVD “Diz o Alberto”. \end{minipage} &      \begin{minipage}[c][14ex][c]{14ex}\centering Corpo de Alunos e Professores de todas as disciplinas. \end{minipage} &      \begin{minipage}[c][14ex][c]{14ex}\centering 1.º, 2.º e 3.º Períodos \end{minipage} &       $\times$&       &       &       &       &       &       &       & \multirow{3}{*}{\rotatebox{90}{Observação de comportamentos. Registo dos consumos.}}     \\ \cline{ 4-15}           &       &       &      \begin{minipage}[c][10ex][c]{40ex}Medição sectorial do consumo de água no Internato.\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Contadores\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering IPE\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering 1.º, 2.º e 3.º Períodos\end{minipage} &       $\times$&       &       &       &       &       &       &       &      \\ \cline{ 4-15}           &       &       &      \begin{minipage}[c][10ex][c]{40ex}Monitorização diária dos consumos de água.\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Contadores\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Alunos e Militar responsável.\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering 1.º, 2.º e 3.º Períodos\end{minipage} &       $\times$&       &       &       &       &       &       &       &      \\ \cline{ 4-16}           &       &       &      \begin{minipage}[c][10ex][c]{40ex} Aproveitamento das águas pluviais para rega do canteiro destinado à Agricultura Biológica\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Bidões e mangueiras usadas\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering Militares, alunos e professores.\end{minipage} &      \begin{minipage}[c][10ex][c]{14ex}\centering 1.º, 2.º e 3.º Períodos\end{minipage} &       $\times$&       &       &       $\times$&       $\times$&       &       &       & \multirow{0}{*}{\rotatebox{90}{Registo fotográfico.}}     \\          \end{longtable}     \end{landscape}     \end{document}      ![Figura5](http://i.stack.imgur.com/phhSe.png)


title: Sync tree panel in Winedt with editor

text: I am wondering if there is any way to make the tree panel (TOC) in Winedt to jump to the item that the focus is on in the editor windows? Also if there is anyway to not lose the track of where the current item is in the tree panel when we re-build the tree? Let's say in the tree we are in section 2. If we now re-build the tree, it will refresh the tree and closes all the + signs. Then we have to again find the section in TOC. I know that it is just couple of clicks, but when you do it hundreds of time, it is going to be annoying!


title: What dimensions and how to insert an image as a cover?

text: I viewed any message but I don´t reach the solution. I want to make an imge to use as cover for my final job. What dimension do you recommend? in pixels(better) or cm? or What proportions? to the image. and when I have the cover.jpg. How can I insert as the 1st page in my job?, preferly without margins. I usually use pstricks, not tikz (I know that this message can be dislike for any of you, so... If it´s neccesary... I delete it.)


title: Two text lines in `flalign` environment

text: I want to achieve what the picture shows below. Basically, I want those two very long text lines to split into two lines shown below. My major problem is that if I keep the text in one line in `flalign`, then the entire right-side text will shift to the left. Here is my code. ![enter image description here](http://i.stack.imgur.com/QPh43.jpg)               \documentclass[a4paper]{article}     \usepackage{mathtools}     \usepackage{nccmath}     \usepackage[margin=1in]{geometry}          \newcommand \widebox[1]{\setlength\fboxsep{6pt}\boxed {\enspace#1\enspace}}     \newcommand \dpartial[2]{\frac{\partial #1}{\partial #2}}     \newcommand \ddef[2]{\frac{d #1}{d #2}}     \newcommand \spac{\\[0.6em]}          \setlength\parindent{0pt}     \numberwithin{equation}{section}          \title{\vspace{-5em} QM Formula List}     \author{David}     \date{}          \begin{document}     \maketitle     \begin{flalign*}        &i\hbar \dpartial{\Psi}{t} = -\frac{\hbar ^2}{2m}\dpartial{^2 \Psi}{x^2}+V\Psi &&\text{Shr\"odinger Equation}\spac        &\widehat{p} = -i \hbar \dpartial{}{x}                                         &&\text{Momentim Operator} \spac        &\widehat{H} = -\frac{\hbar ^2}{2m} \ddef{^2 \psi}{x^2} + V                    &&\text{Energy Operator} \spac        &-\frac{\hbar^2}{2m}\ddef{^2 \psi}{x^2} + V \psi = E \psi                      &&\text{Time-independent Schr\"odinger Equation} \spac     \end{flalign*}     \end{document}


title: Fix the value of the vertical space before/after \Large

text: Is there any way to fix the value of the vertical space before and after `{\Large ...}` to be 1.0em? Sometimes I use `{\Large ...}` just after or before a theorem and the theorem spacing requirements seem to have priority. The same thing possibly happens if I use `{\Large ...}` after or before a math equation. E.g.               \documentclass[12pt]{report}     \usepackage{parskip, enumerate, xcolor, amsmath, amssymb, amsthm}          \newtheoremstyle{mydef}       {1.0em}   % ABOVESPACE       {1.0em}   % BELOWSPACE       {\normalfont} % BODYFONT       {0pt} % INDENT (empty value is the same as 0pt)       {\bfseries}   % HEADFONT       {.}   % HEADPUNCT       {5pt plus 1pt minus 1pt}  % HEADSPACE       {}    % CUSTOM-HEAD-SPEC          \theoremstyle{mydef}     \newtheorem{thm}{Theorem}          \newcommand{\Largebf}[1]{\textbf{{\Large #1 }}}          \begin{document}         \Largebf{Introduction}              \begin{thm}             Let $I \subset \mathbb{R}$ be an interval (bounded or not) and let $(f_n) : I \to \mathbb{R}$ be a sequence of $C^1$ functions. Suppose             \begin{enumerate}[i)]               \item $f_n \to f$ simply on $I$;               \item $f_n' \to g$ uniformly on $I$.             \end{enumerate}             Then $f$ is differentiable on $I$ and $f' = g$. Put differently, under these hypotheses,             \[                 (\lim_{n \to \infty} f_n)' = \lim_{n \to \infty} f_n'.             \]         \end{thm}              \Largebf{Wonderful result}              \textcolor{red}{Write this.}              \Largebf{Not-so-wonderful result}              The following theorem should not be surprising :         \[             1 \neq 19.         \]              \Largebf{Conclusion}              This would be the conclusion!     \end{document}      So my **question** is: How to fix the value of the vertical space before and after `{\Large ...}` (or `\Largebf{...}` as in the code above) to be, say, 1.0em, no matter what (I want to give this condition the first priority).


title: 2 different captions for tables and figures

text: I want 2 different types of captions. One for table and another to figures. I use this code for tables:               \usepackage[labelfont=bf,nooneline]{caption}     \setlength{\abovecaptionskip}{3pt}      and this for figures:               \usepackage[labelfont=bf]{caption}      the difference between things is in `nooneline`. It is possible?


title: TexShop diacritic encoding

text: A newbie question. I have a number of colleagues who always use a different editor rather than texshop to edit, but use texshop to compile nonetheless. The reason I was told is that texshop corrupt the encoding. Is there a way to overcome that? Whenever I have a tex file with diacritics in UTF8-encoding, texshop will show the diacritics properly but will corrupt it if I save it again even though I have UTF8-encoding in preference. A minimal example: ā Viewed from another editor: \UTF{0101}% Many thanks!


title: Custom citing command. Bibtex key as parameter to \newcommand

text: I'm new to LaTeX and I want to define an auxiliary command for citing. What I would like to achieve is a `\newcommand` or similar that takes a BibTeX parameter such as `paper` and produces the same output as:               (Image from \cite{paper})      Instead I would like to write:               \imfrom{paper}      I have tried the following:               \newcommand{\imfrom}[1]{(Image from \cite{#1})}      It works, but it is not type safe, so Kile's auto-completion does not work. Is there any way this could be done easily? Thanks in advance!


title: page overflowing in table environment due to content outside tabulars

text: We made a command to print our software requirements but now that we hit things that use a lot of space we have an overflow issue. We used a `table` environment to keep everything together and avoid weird things like a final bar ending up on a different page but this clearly is a hack. I use two `tabular`s as writing text in a huge table cell was frustrating that a white line didn't results in a paragraph brake anymore. How do I change this such that the overflows are gone and if a requirement gets spread over 2 pages each part has at least a few lines of content? Preferably without having to edit to much cases where this is already used?               \documentclass[12pt,a4paper]{report}          \usepackage{booktabs}          \newcommand{\requirement}[5]{         \begin{table}[H]       \begin{tabular*} {\textwidth} {  p{0.70\textwidth} r }          \toprule         \emph{#3} & \textbf{ID.#1.#2} \\         \midrule       \end{tabular*}         #4                 \vspace{10pt}         \textbf{Motivation:}\\         #5            \vspace{-5pt}       \begin{tabular*}{\textwidth}{@{}p{\textwidth}}            \bottomrule       \end{tabular*}       \end{table}     }          \begin{document}     long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long     long\\long\\long\\long\\long\\long\\          \requirement{R}{6}{Name}     {Requirement way to long     long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long          long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long          long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long          long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long\\long     }     {motivation}          \end{document}


title: Using soul with indirect formatting applied

text: I am using the `soul` package to underline omitting the descenders. It seems that passing the following as a parameter works fine                \textit{special text}      but if the `\textit` is applied indirectly via the macro `\ApplyStyle` then I get the error: > Argument of \ApplyStyle has an extra }. ## Question: Is it possible to allow for this indirect application of the style by changes to the `\varul` macro? If not, what other options are available (except of course for applying the formatting directly within the invocation of the `\varul` macro -- that would just be too easy :-))? ## Code:               \documentclass{article}     \usepackage{xparse}     \usepackage{xcolor}     \usepackage{soul}     \usepackage{xspace}               %% ----------------------------------------------------------------     %%                http://tex.stackexchange.com/questions/36894/     %%                    underline-omitting-the-descenders     %%     %%     \makeatletter     \ExplSyntaxOn         \cs_new:Npn \white_text:n #1           {             \fp_set:Nn \l_tmpa_fp {.01}             \fp_mul:Nn \l_tmpa_fp {#1}             \llap{\textcolor{white}{\the\SOUL@syllable}\hspace{\fp_to_decimal:N \l_tmpa_fp em}}             \llap{\textcolor{white}{\the\SOUL@syllable}\hspace{-\fp_to_decimal:N \l_tmpa_fp em}}           }         \NewDocumentCommand{\whiten}{ m }             {               \int_step_function:nnnN {1}{1}{#1} \white_text:n             }     \ExplSyntaxOff          \NewDocumentCommand{ \varul }{ D<>{5} O{0.2ex} O{0.1ex} +m } {%     \begingroup     \setul{#2}{#3}%     \def\SOUL@uleverysyllable{%        \setbox0=\hbox{\the\SOUL@syllable}%        \ifdim\dp0>\z@           \SOUL@ulunderline{\phantom{\the\SOUL@syllable}}%           \whiten{#1}%           \llap{%             \the\SOUL@syllable             \SOUL@setkern\SOUL@charkern           }%        \else            \SOUL@ulunderline{%              \the\SOUL@syllable              \SOUL@setkern\SOUL@charkern            }%        \fi}%         \ul{#4}%     \endgroup     }%     \makeatother     %% ----------------------------------------------------------------          \newcommand{\ApplyStyle}[1]{\textit{#1}}%          \begin{document}     \varul{\textit{special text}\xspace}%      Works!!          \varul{\ApplyStyle{special text}\xspace}%  Does NOT work     \end{document}


title: Reduce space between title and bars in pgfgantt

text: I think the space between title and bars in pgfgantt is too big. Is there a way to reduce it? For example, this code               \begin{ganttchart}[ x unit = 0.30cm,                         y unit chart = 1.3cm,                         hgrid,                         vgrid={draw=none,dotted},                         time slot format = isodate-yearmonth,                         compress calendar,                         today=2014-4,                       ]{2013-05}{2017-02}         \gantttitle{2013}{8}         \gantttitlelist{2014,2015,2016}{12}         \gantttitle{2017}{2}\\         \gantttitlelist[title label font=\tiny ,y unit title = 0.7cm]{5,...,12}{1}         \gantttitlelist[title label font=\tiny ,y unit title = 0.7cm]{1,...,12}{1}         \gantttitlelist[title label font=\tiny ,y unit title = 0.7cm]{1,...,12}{1}         \gantttitlelist[title label font=\tiny ,y unit title = 0.7cm]{1,...,12}{1}         \gantttitlelist[title label font=\tiny ,y unit title = 0.7cm]{1,2}{1}\\         \ganttbar{Task 1}{2013-05}{2014-08}\\         \ganttbar{Task 2}{2013-12}{2015-05}\\         \ganttbar{Task 3}{2014-12}{2016-11}     \end{ganttchart}      renders a picture with a too large space between the months and the tasks... making it difficult to read. Is there a way? Thanks


title: Where I can get the chapterx package?

text: I was viewing a good page where Yiannis Lazarides show how to use chapterx and put it on google drive but right now it does´t exist, some one have it o know how to get it? Thank you in advanced


title: Line Numbering with \usepackage{dramatist}?

text: I would like to number lines every 5 lines, save the first line in each scene. This is what I have so far: Just for clarification, I am using `\usepackage[lnps]{dramatist}`. My MWE:               \documentclass{book}           \usepackage[T1]{fontenc}      \usepackage{fourier}      \usepackage[english]{babel}      \usepackage{amsmath,amsfonts,amsthm}          \usepackage{lipsum}      \usepackage[lnpa]{dramatist}     \usepackage{sectsty}      \allsectionsfont{\centering \normalfont\scshape}           \usepackage{fancyhdr}      \pagestyle{fancyplain}      \fancyhead{}      \fancyfoot[L]{}     \fancyfoot[C]{}      \fancyfoot[R]{\thepage}      \renewcommand{\headrulewidth}{0pt}      \renewcommand{\footrulewidth}{0pt}      \setlength{\headheight}{13.6pt}           \numberwithin{equation}{section}      \numberwithin{figure}{section}      \numberwithin{table}{section}                     \newcommand{\horrule}[1]{\rule{\linewidth}{#1}}           \title{      \horrule{0.5pt} \\[0.4cm]      \Huge \emph{Octavia} \\      \horrule{2pt} \\[0.5cm]      \normalfont \normalsize      \textsc{a play in three acts} \\ [25pt]}           \author{---The Authors---}      \date{}     \begin{document}          \maketitle                \Character[\textbf{Octavia}---The Main Heroine]{Octavia}{Octa}     \Character[\textbf{Marc Antony}---Octavia's Husband]{Antony}{Marc}     \Character[\textbf{Cleopatra}---Queen of Ptolemaic Egypt and Lover of Marc Antony]{Cleopatra}{Cleo}     \Character[\textbf{Octavian}---Octavia's Brother]{Octavian}{Oct}     \Character[\textbf{Caesarion}---Cleopatra's Son with Julius Caesar]{Caesarion}{Caesar}     \Character[\textbf{Servius}---Octavia and Antony's Servant]{Servius}{Serve}     \Character[\textbf{Children}---Cleopatra's Children with Antony]{Children}{Child}     \Character[\textbf{Chorus}---Both Octavia's Handmaidens and the People of Egypt]{Chorus}{Chorus}     \Character[\textbf{Senator 1}---Member of the Roman Senate]{Senator 1}{1}     \Character[\textbf{Senator 2}---Member of the Roman Senate]{Senator 2}{2}     \Character[\textbf{Senator 3}---Member of the Roman Senate]{Senator 3}{3}     \settowidth{\speakswidth}{\speaksfont{Frederico}\speaksdel\hspace{\speechskip}}          \DramPer          \Act{}     \Scene{Octavia's Bedchambers}          \StageDir{         \begin{center} Darkness          \end{center}     }     \StageDir{Octavia Sits, Reclined on a Couch. Chorus of Handmaidens Listens, Half-Intently}     \begin{drama}     \Octaspeaks Years ago, Barely widowed, I was informed of my marriage to Antony. It was a hasty patch of a ruined relationship.  My brother Octavian had never gotten along with Antony, and rather than kindness, he gave him his sister.  Our relationship may have been political in its reasoning, (which marriages aren't, after all) but I can't complain.  Most women envy me for his power and riches, but I don't see the reason in that. I guess you could say we fell in love. Many of my fondest memories were when we walked together, confidently through the forum. I had no need to worry with Antony by my side. I recall one instance in particular, which I found quite humorous: we were taking our mid-day stroll, when we bumped into my brother in the Forum. Antony tensed up, as did Octavian, seemingly wanting to throw a fist or two. But I, I stepped in between the two of them and grabbed Antony by the waist, pressing his lips against mine. My brother was mortified! By then, we had even drawn quite a crowd with the people, and they burst into laughter at the sight of my brother's face. Even Antony, still begrudging the loss of a fight with Octavian, couldn't help but chuckle a bit.           I do not hate my brother, no. We  get along quite nicely, as a matter of fact. When Antony was here, though, I did not meet up with him nearly as often as I do now. It is strange, watching your little brother slowly gain power over the Roman world. I have had my qualms with his politics, but he \emph{is} my brother; I grew up with him! I put up with his bullshit every day! Now that he is older, he has become more rational, and I do agree with his views a bit more. Though I still wish he and Antony would just get along! Oh, Octavian can be a fickle soul, and he once loved Antony as much as I do now.      \end{drama}     \StageDir{Enter Servius}     \begin{drama}          \Servespeaks Madam, a letter for you just arrived earlier this morning.     \Octaspeaks Please, from whom is this letter? Is it my beloved Antony? I need to know!     \end{drama}     \StageDir{Servius clears his throat}     \begin{drama*}     \Servespeaks A letter from Antony, yes, this is.     \end{drama*}     \end{document}      I would like line numbers to the right of the prose, around 3 or 4 spaces off to the side. I would also like line numbers for verse to be in the same column. ![enter image description here](http://i.stack.imgur.com/fx5S8.png)


title: movie15 - not show on the PDF

text: Not working?               \documentclass{beamer}      \usepackage{movie15}      \usepackage{graphics}      \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[polish]{babel}     \selectlanguage{polish}           \begin{document}      \begin{frame}{Simulation}      \begin{picture}(320,300)      \put(0,80){\includemovie[poster, text={\small(Loading 11.mp4)}]{9cm}{6cm}{11.mp4}}      \put(90,260){Rotating sine}      \end{picture}      \end{frame}      \end{document}      and               \begin{frame}{Filmy *.avi}       \begin{columns}     \begin{column}{5cm}     \begin{block}{}     \small     Symulacja      \end{block}     \end{column}\pause \     \begin{column}{4.2cm}     \begin{block}{}     \includemovie[autoplay,repeat]{4cm}{3cm}{11.mp4}     \end{block}     \end{column}     \end{columns}     \end{frame}      any idea?


title: email adress renders incomplete mailto in PDF

text: When I put `\email{e.xmaple@example.com}` in a LaTeX document the resulting PDF shows the email address correct, but the link points to `.xample@example.com`. de character before the dot gets left off. How do I fix this? (I'm a newbie at LaTeX.)


title: Fill between two plots

text: I have drawn two lines such as,               \documentclass{article}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}          \draw [->] (-5,0) -- (5,0) node [above left]  {$x$} ;     \draw [->] (0,-5) -- (0,5) node [below right] {$y$} ;     \draw[dashed,domain=0:5] plot (\x, -\x) node [right] at (4,-3) {$y=x$};     \draw[domain=-5:0] plot (\x, \x);               \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/5viho.png) How can I fill the area between these two lines and write something in it?


title: 'Undefined control sequence' error when defining a color through a macro

text: I'm trying to color a cell using its data value. However, when I try to compute some value (using the content of the cell) then the definition of the color `color!\somemacro` in the `\cellcolor` does not work. Where the `\somemacro` stores the result of the computation. The error I got is: > ! Undefined control sequence. blue!\y Why is this happening? I guess that the problem has to do with the expansion part of the macros, but I don't know how this works. Can someone also explain how/why this happens and how to avoid it?               \documentclass{article}     \usepackage[table]{xcolor}     \usepackage{pgfplotstable}          \pgfplotstableset{         color cells/.style={             col sep=comma,             string type,             postproc cell content/.code={%                     \pgfkeysalso{@cell content=\rule{0cm}{2.4ex}%                     \pgfmathsetmacro\y{round(##1 * 0.5)}\cellcolor{blue!\y}%                     ##1}%                     }         }     }          \begin{document}     \begin{table}\caption{Colors}     \centering     \pgfplotstabletypeset[color cells]{     a,b,c,d     50,300,200,100     20,0,100,200     }     \end{table}     \end{document}


title: Variable argument command

text: I'm typesetting some group theory notes, and a significant amount of it is cycles, i.e. `\left(1\,2\,3\right)`. Is there a way of defining a command which takes a arbitrary number of arguments so I can write `\cycle{1}{2}{3}`?


title: Center longtable horizontally over two pages in landscape

text: I have a longtable in a landscape environment that ranges over two pages, and where I have introduced a page break where it is most appropriate contentwise. The table including descriptions is too long to be displayed on one page only but doesn't really fill two full pages either. I therefore split it in half, which gives me a leftward alignment. This doesn't look too appealing, so I'm trying to center it horizontally (ie, when viewed in portrait mode). For the first page, I have succeeded in doing that, but not for the second. Here's my code:               \begin{landscape}       \begin{centering}         \begin{longtable}{lcccccccc}           \noalign{\vspace*{\fill}} % This is to center "from the left-hand side" (from a portrait POV)           \caption{My caption}\\           \label{MYLABEL}           ...           \multicolumn{9}{c}{(continued on next page)}\\           \noalign{\vspace*{\fill}} % This is to center "from the right-hand side" (from a portrait POV)           \pagebreak % Manual page break so it "looks better"           \noalign{\vspace*{\fill}} % This is to center "from the left-hand side" on the second page, which doesn't work.           \caption*{My caption (continued)}\\           ...         \end{longtable}       \end{centering}       \noindent {\scriptsize \textit{Notes} --- Here's a more detailed description of the table.       }     \end{landscape}      As already stated in the comments `\noalign{\vspace*{\fill}}` doesn't change anything on the second page, whereas the vspacing works just fine on the first page. What am I doing wrong/missing?


title: Lyx: ensure runninghead always on right

text: I create a running heading with the command "runninghead" Now the running head is on every other side on the left side. I want to print the work onesidedly so I want to get the running heading on every page on the right side.


title: Angled self referencing arrows in sequence diagram

text: I am adapting an example of a sequence diagram I took form texample.net. http://www.texample.net/tikz/examples/sequence-diagram/ Unfortunately I am having some difficulties. How would I draw a self referencing arrow? I have attached a picture with a red arrow to symbolize what I am talking about. How would I do that in Tex?![enter image description here](http://i.stack.imgur.com/80SYI.png)


title: Hyperlinks on moderncv not working Adobe Acrobat Pro

text: So, I know there's already a question about this (Hyperlink in moderncv with acrobat reader) but I have tried the solutions there (updating and security settings) and it still doesn't work and I don't think that is a Adobe problem since I have other documents (not moderncv) where the links work perfectly. I am using Adobe Acrobat Pro XI. The links do work on Preview. Here's a MWE:               \documentclass[11pt,a4paper,dvipsnames]{moderncv}          \moderncvtheme[blue]{classic}     \usepackage[scale=0.8]{geometry}     \usepackage[utf8]{inputenc}          \firstname{First name}     \familyname{Last name}     \title{Curriculum Vitae}     \address{Address line 1}{Address line 2}     \mobile{Phone}     \email{Email}          \AtBeginDocument{\hypersetup{colorlinks, urlcolor=NavyBlue}}          \begin{document}          \section{Education}     \cventry{Year}{Degree}{University}{Location}{GPA. \href{http://www.google.com}{Google}}{}               \end{document}      Thanks


title: Wrapfig induces an empty box on the next page

text: I am writing a document, and have been using the wrapfig environment without problems, however, for one of my figures I encounter the following problem. The figure is placed neatly and in the right place, but on the next page of my document an extra box is created that fits the figure but is empty. I do not know why it does this. If it helps, here is the code I use:               \begin{wrapfigure}{r}{0.5\textwidth}     \centering     \includegraphics[width=0.48\textwidth]{FigName}     \caption{\textbf{Captiontext}\textit{Captiontext}}     \label{figLabel}     \end{wrapfigure}      Is this a known problem, or does anyone know how to get rid of this extra box?


title: Foreshortened Curved Arrow in TikZ

text: I need to show the rotational symmetries of a tetrahedron, and I've settled on using Sketch-generated TikZ code. I've included \usepackage{tikz}, \usetikzlibrary{arrows} and \usepackage{pstricks} so far. I'm happy with everything except the arrow showing rotation about the axis in the following code:               % Sketch output, version 0.3 (build 7, Fri Feb 24 21:22:17 2012)     % Output language: PGF/TikZ,LaTeX     \begin{tikzpicture}[line join=round]     \draw[color=blue](-.068,-.403)--(-.275,-1.609);     \draw[color=blue](.07,.402)--(-.068,-.403);     \filldraw[fill=white](.683,-.683)--(-.233,-.111)--(-.82,-.122)--cycle;     \filldraw[fill=lightgray](-.233,-.111)--(.372,.916)--(-.82,-.122)--cycle;     \filldraw(-.82,-.122) circle (2pt);     \filldraw[fill=white](.683,-.683)--(.372,.916)--(-.233,-.111)--cycle;     \filldraw(.683,-.683) circle (2pt);     \filldraw(.372,.916) circle (2pt);     \draw[color=blue](.071,.403)--(.07,.402);     \draw[color=blue](.277,1.609)--(.071,.403);     \filldraw(-.233,-.111) circle (2pt);     \fill[black,font=\footnotesize]             (.683,-.683) node [below right] {$X$}             (.372,.916) node [right] {$Y$}             (-.233,-.111) node [right] {$Y$}             (-.82,-.122) node [below left] {$X$};\draw (.208,1.207)+(-60:.25)             [yscale=1.3,->] arc(-60:240:.25);\end{tikzpicture}% End sketch output      How can I get the arc (drawn in the final line) to be foreshortened so it actually looks like rotation around the axis (drawn in blue)? Better yet, is there a way to describe this in Sketch, or any other tikz-code generating environment? If you want, I can edit and include the Sketch code that generated this scene.


title: Internal line numbers end before last unended paragraph

text: I'm currently working on a project where I want linenumbers to appear for text in a table-environment. Lineo provides the command `\internallinenumbers` for this task. As far as I understood, the normal behavior of lineo should be to wait for a paragraph to be broken into lines and than add the line numbering. The `\internallinenumbers` command does not seem to completely respect this routine, as it stops the linenumbering after the last paragraph of the current page and sets the remaining linenumbers in empty space on the next page. The following minimal example can be used to reproduce the behavior:               \documentclass[11pt]{article}     \usepackage{blindtext}          \usepackage{lineno}          \begin{document}          \begin{bframe}     \internallinenumbers          \Blindtext          \end{bframe}          \end{document}        ![Rendered output of the minimal example](http://i.stack.imgur.com/AAt39.png) Does anyone know how to fix this?


title: Algorithm2e comment line alignment problem

text: I would like to align a comment within the algorithm environment of algorithm2e in such a way that each line of a multi line comment is left aligned. See the following MWE. In this MWE the second and third line of the comment are left aligned with the pseudo code of the algorithm. I would like to align them with the first line of the comment, so the word 'in' and 'algorithm' should be aligned to the word 'One' of the first line.               \documentclass{article}     \usepackage{algorithm2e}     \begin{document}     \begin{algorithm}[tbp]     \LinesNumbered     \caption{Text}     \label{alg:Algo}          \BlankLine          $a \gets (a+1)^a$\tcp*{One long comment line which should be aligned in such a way that the comment shouldn't go into the algorithm}          \Return{Result}\;     \end{algorithm}     \end{document}      **Edit:** An edit in response to the answer of Steven B. Segletes. There is a problem with the alignment if the line with the comment is nested in a loop. Also there are warnings of undefull hboxes, because of the parbox. MWE:               \documentclass{article}     \usepackage{algorithm2e}     \newlength\algowd     \def\savewd#1{\setbox0=\hbox{#1\hspace{.7in}}\algowd=\wd0\relax#1}     \newcommand\algolines[2]{\savewd{#1}%       \tcp*{\parbox[t]{\dimexpr\algowidth-\algowd}{#2}}}     \begin{document}          \begin{algorithm}[tbp]     \LinesNumbered     \caption{Text}     \label{alg:Algo}          \BlankLine          \ForEach{$a \in A$}{        \algolines{$a \gets (a+1)^a$}{One long comment line which should be aligned in such a way that the comment shouldn't go into the algorithm}      }          \Return{Result}\;     \end{algorithm}          \end{document}


title: How to show this tag $\mathbbmss{x}$ in PostScript or PS format?

text: `\mathbbmss{x}` \- This tag in viewable in DVI format but after creating a PostScript or PS format, the symbol will disappear.


title: How to avoid setting hard-coded values to the point arguments of pspicture?

text: I want to shrink and expand the canvas based on the 2 variables `\Base` and `\Angle`. The following code still use a hard-coded value for the ordinate of `pspicture`, which is equal to 6, for example. I want to avoid using such a hard-coded value. I want to replace it by something that equals to `Angle tan Base mul`. Is there any idea to do so?               \documentclass[border=12pt]{standalone}          \usepackage{pstricks-add}          \def\Base{3}     \def\Angle{60}          \pstVerb     {         /Base \Base\space def         /Angle \Angle\space def     }          \begin{document}     \begin{pspicture}[showgrid=top](\Base,6)         \pspolygon[fillcolor=yellow,fillstyle=solid](!Base 0)(!0 Angle tan Base mul)     \end{pspicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/fgPJH.png)


title: How to insert line before if/while-clause using Algorithms2e?

text: When I insert more than one new line before the if-clause of an algorithm; or a new line between two if-clauses in an Algorithms-section, I get the following error: []               ! LaTeX Error: There's no line here to end.      Here follows extracts from my code:               \usepackage{algorithm2e}       \begin{algorithm}[h]     (..)     \\                 \If{ $currentFecUnit$ > $HIGHEST\_FEC\_UNIT\_NR\_DECODED\_GLOBAL$ OR                 ( $currentFecUnit$ == 0 AND $nrOfPacketsReceived$ == 1 ) }                 {                   ExtractPktHeaderAndPutIntoGlobalFecUnitHeaderValues ()                  }      How do I add one more line before the if-clause without gettin syntax-error?


title: Figure numbering IN figure

text: I'm using the `subfig` package which works like a charm. However, I only use the subfigure numbering (so no subcaptions, all the info will be in the main caption) but these are placed below the image which looks funny. I'd prefer to put the a., b., c. etc. stuff inside (or on top, if you please) my figure, for instance in the upper left corner like is possible for a legend. I'm not sure if it is relevant, but I'm using TikZ figures. Possibly the caption could also be defined in the .tikz code so I could use `axis cs:` for the placement of the number (a., b. etc). Is this doable? I can't find anything related on the web or in the manuals.


title: Create a ybar interval from given bar widths

text: I am collecting data using the NASA Task Load Index, which gives 6 scales and has a weight associated with each scale. I am trying to plot the mean value for each scale using a ybar interval graph, whereby the width of each bar is set by the weight for the corresponding scale, similar to the picture below taken from the manual. ![Desired output](http://i.stack.imgur.com/kLI2F.png) I have managed to create an additional column that should give me the right interval data (see table), but the bar width doesn't look correct, nor am I able to then use the symbolic x coords as labels for the bars.               \documentclass{article}          \usepackage{pgfplots}     \usepackage{pgfplotstable}          \begin{document}          \pgfplotstableread{       Scale    Mean  Weight       MD      53.25    3.50       PD      12.22    1.50       TD      18.46    1.75       FR      45.75    3.00       OP      59.18    2.45       EF      22.15    2.80       Overall 38.175   2.50     }{\tlxweightedratings}          \pgfplotstabletypeset[       columns/Scale/.style={string type},       create on use/Interval/.style={         create col/expr={\pgfmathaccuma + \thisrow{Weight}}},       columns={Scale, Mean, Weight, Interval},     ]{\tlxweightedratings}          \begin{tikzpicture}       \begin{axis}[ybar interval, xtick=data,           nodes near coords,           %symbolic x coords={MD, PD, TD, FR, OP, EF, Overall},       ]         \addplot+ table[x=Interval, y=Mean,           create on use/Interval/.style={             create col/expr={\pgfmathaccuma + \thisrow{Weight}}},         ] {\tlxweightedratings};       \end{axis}     \end{tikzpicture}     \end{document}


title: \newcommand with optional multi-line argument and implicit itemize environment

text: While drafting a text, I want to subdivide and group text pieces and keywords to easily reorder them throughout the document. Examples for such a group of text pieces would be: * * * _Example 1): Two arguments (2nd is optional and multi-line)_ Having in the LaTeX file something like...               \mycommand{Summary of this paragraph (always provided)} {         optional textline 1         optional textline 2         ...     }      ...should result in the pdf as... > **Summary of this paragraph (always provided)** > >   * optional textline 1 >   * optional textline 2 >   * ... > * * * _Example 2): One argument_ Having in the LaTeX file something like...               \mycommand{Summary of this paragraph (always provided)}      ...should result (without optional arguments) in the pdf as... > **Summary of this paragraph (always provided)** * * * I tried already some things with `\newcommand` but I'm not a real expert. The needed features would be   * `\mycommand` gets at least one argument and prints this to the PDF (e.g. in **bold letters** )   * `\mycommand` takes a variable number of following lines (in parenthesis) as second argument and adds for each new line an `\item` to an `\itemize` list (without writing the `\item` in the `.tex`-file)   * Changing the `\mycommand` to display only text would then finally generate a running text without the need of removing the `\item` commands. Any help appreciated.


title: Coding an equation with description

text: I want to code this equation in LaTeX: ![equation](http://i.stack.imgur.com/rXe9Q.png) I'd like to know how to code the equation and the description below it with a reference as well.


title: How to create geometry tolerance symbols with TikZ?

text: I am a beginner in LaTeX, trying to use it for an industrial metrology test report, where I need to use geometry tolerances. I have tentatively made a first one with TikZ, but this is hard coded and therefore not flexible. I need in some cases to change the number of reference planes from only 1 to 3 such as in the example (A,B,C) Conversely there is a need to use one or two digits in the main tolerance, and sometimes a symbol (such as "DIA") as prefix. It seemed to me that using chains would be a much more promising route, but I cannot make it work, the symbol is not placed at the left side, and the lines do not align properly. Would someone suggest a solution?               \documentclass[11pt ]{article}     \usepackage{tikz}      \usetikzlibrary{chains}     \usetikzlibrary{positioning}     \renewcommand{\familydefault}{\sfdefault}          \begin{document}     \Large     \newcommand{\postol}[4]{%     \begin{tikzpicture}[scale=.7]     \draw (-1em,0) -- (1em,0);     \draw(0,-1em) -- (0,1em);     \draw (0,0) circle ( .6 em);     \draw (1em, -1em) --(1em, 1em);     \draw (2.5em, 0) node{#1};     \draw(4em,-1em) -- (4em,1em);     \draw (5em, 0) node{#2};     \draw(6em,-1em) -- (6em,1em);     \draw (7em, 0) node{#3};     \draw(8em,-1em) -- (8em,1em);     \draw (9em, 0) node{#4};     \draw (-1 em,-1em) rectangle (10 em, 1 em);     \end{tikzpicture}} %          \postol{0.32}{A}{B}{C}          \newcommand{\tolgeom}[1]{     \node[rectangle, draw, on chain=going right]{     #1}}%          \begin{tikzpicture}[scale=1,         start chain,         node distance=0pt]         \draw (-1em,0) -- (1em,0);     \draw(0,-1em) -- (0,1em);     \draw (0,0) circle ( .6 em);     \tolgeom{0.32};\tolgeom{A}; \tolgeom{B};\tolgeom{C};     \end{tikzpicture}          \end{document}


title: How to create sets and name it

text: I have a requirement to create a document similar to the attached image. I am working with Sanskrit alaphabets and there is a name for each set as shown in the image. In english there is no set other than broad division of Vowels and consonants. I could have posted image with Sanskrit text but lot of people here do not have that font. I would really appreciate your help. one way I thought of was, to create nodes around each letter in Tikz but not sure if there is any easy method out there. ![enter image description here](http://i.stack.imgur.com/MFGBU.jpg) PS: I could not think of a good question title I am adding output based on @Yori's solution. Everything work great except I did not get straight lines. I guess the issue is with Devanagari fonts. I highlighted the issue with red circle, the line is not horizontal its slanted. Sorry I could not attach image to my comment to I am modifying here. if you feel I should start a new question I can do that as well. ![enter image description here](http://i.stack.imgur.com/hPqKa.png)


title: Possible to wrap multiple rows within a column at one time?

text: I am producing a document that has "interlinear" qualities. As such, it would be much simpler if I could wrap multiple lines of text at one time. Here is an example of what I want: Let's take these three sentences as our examples: > 1) This is the first line of the document.   >  2) Here is the document's second line.   >  3) The third line of the document is here. Ordinarily, table wrapping might produce something like this for these three lines: > 1) This is the first line of the   >  document.   >  2) Here is the document's second   >  line.   >  3) The third line of the document   >  is here. However, I would like all three of the lines to wrap as a group. Here is my desired output: > 1) This is the first line of the   >  2) Here is the document's second   >  3) The third line of the document   >  document.   >  line.   >  is here. The three lines are wrapping as a group, not individually. Is this possible? If so, how?


title: Tikz: How to place wordings nicely with the drawing (in block diagram)?

text: This is my first attempt to create a figure using Tikz package in LaTex. (I am using TexMaker btw). So I have taken example codes here and there and slightly modified to come up with the figure that I want, but the words in my figure is not aligned as I intended.   Here are the corrections that I wish to make:   1. The wordings are written over the loop arrows -> I would like the wordings cleared away from the loop arrows.   2. I would like to have words below the symbol. So, the wording 'resisted infection' to appear below the symbol zeta. Same for 'not cured'   3. Same for the wordings associated with straight arrows. I would prefer to have symbols above the arrow as it is, but the wordings possibly below the arrow. (Or even just below the symbol and above arrow) ![enter image description here](http://i.stack.imgur.com/iHSrL.png) Here is my code:               \documentclass[11pt]{article}          \usepackage[margin=0.5in]{geometry}     \usepackage{amsmath}     \usepackage{tikz}     \usetikzlibrary{arrows}          \title{Discrete Time SIR Model - Stochastic analysis}     \author{Louis Kim}          \begin{document}     \maketitle          \tikzstyle{int}=[circle, draw, fill=blue!20, minimum size=3em, auto]     \tikzstyle{init} = [pin edge={loop,thin,black}]          \begin{tikzpicture}[node distance=5cm,auto,>=latex']         \node [int, pin={[init] $\zeta_{i,t}$,resisted infection}] (a) {$S$};         \node [int, pin={[init] $1-\delta$,not cured}] (c) [right of=a] {$I$};         \node [int] (e) [right of=c] {$R$};         \path[->] (a) edge node {$1-\zeta_{i,t}$, not resisted infection} (c);         \draw[->] (c) edge node {$\delta$, cured} (e) ;     \end{tikzpicture}     \end{document}      Any help would be greatly appreciated!! Thanks,


title: Checking in LaTeX for a specific character?

text: I have a LaTeX problem that I cannot solve by myself. I have a repeating arrangement of characters which I want to format automatically in LaTeX.               1H-NMR (400 MHz; DMSO-d6): \textdelta  12.41 (s, OH), 7.36-7.30 (m,     Cbz), 7.20 (t, J = 5.5 Hz, NH), 5.00 (s, Cbz-CH2), 3.48 (q, J = 13.4     Hz, N-CH2), 3.33 (t, J = 7.3 Hz, N-CH), 2.96 (q, J = 6.2 Hz, NH-CH2),     1.57 (td, J = 16.8, 9.0 Hz, CH2), 1.40 (d, J = 3.4 Hz, CH2), 1.30-1.24 (m, CH2).      Now I have to change all `J` to italic `*J*`. Of course I can do all these manually but I have quite a lot of these data sets and an automation would be very helpful. I thought of an new environment which changes all J to italic _J_. Is there any possibility? Can I check it with an if-then command? Like `if="character"=J then italic else normal` I hope you can help me with that problem. UPDATE: thanks for all the help. I tried to understand all your suggestions and both work fine for one dataset. I now tried to define a new environment, which I can use for multiple datasets in my work.               \documentclass{article}     \begin{document}     \newenvironment{NMR2}         {             \def\dataset{         }         {             }             \xpatchcmd*{\dataset}{J}{\emph{J}}{}{} % making problems             \dataset         }          \begin{NMR2}     1H-NMR (400 MHz; DMSO-d6):  12.41 (s, OH), 7.36-7.30 (m,     Cbz), 7.20 (t, J = 5.5 Hz, NH), 5.00 (s, Cbz-CH2), 3.48 (q, J = 13.4     Hz, N-CH2), 3.33 (t, J = 7.3 Hz, N-CH), 2.96 (q, J = 6.2 Hz, NH-CH2),     1.57 (td, J = 16.8, 9.0 Hz, CH2), 1.40 (d, J = 3.4 Hz, CH2), 1.30-1.24 (m, CH2).     \end{NMR2}     \end{document}      and I tried the same for the second idea:               \documentclass{article}     \begin{document}     \newenvironment{NMR}         {         \def\oldJ{J} % \oldJ contains "J"         \let\J=\oldJ % \J contains "J"         \catcode`\J=13 % makes J an active character         \defJ{\textit{\J}} % makes J italic         }         {         \catcode`\J=11 %  makes J from an active character to a letter again         }          \begin{NMR}     1H-NMR (400 MHz; DMSO-d6):  12.41 (s, OH), 7.36-7.30 (m,     Cbz), 7.20 (t, J = 5.5 Hz, NH), 5.00 (s, Cbz-CH2), 3.48 (q, J = 13.4     Hz, N-CH2), 3.33 (t, J = 7.3 Hz, N-CH), 2.96 (q, J = 6.2 Hz, NH-CH2),     1.57 (td, J = 16.8, 9.0 Hz, CH2), 1.40 (d, J = 3.4 Hz, CH2), 1.30-1.24 (m, CH2).     \end{NMR}     \end{document}      Both examples making problems and do not work. What am I doing wrong?


title: Possible to create \pgfplotstablenew without header?

text: I'd like to create a (pgfplots)table from scratch, however, one without a header. So I'm trying to modify one of the examples in the `pgfplotstable` documentation:               \documentclass{article}     \usepackage{pgfplotstable}          \begin{document}          \pgfplotstableset{     % define how the ’0’ column shall be filled:     create on use/0/.style={create col/set list={0,1,...,10}}%     }     % create a new table with 11 rows and column ’0’:     \pgfplotstablenew[header=false,columns={0}]{11}\loadedtable     % show it:     \pgfplotstabletypeset[header=false,empty cells with={---}]\loadedtable          \end{document}      ... however, it seems that this `0` is interepreted as a string, not number, especially since trying to use `columns={[index]0}` fails with: > \\! Package pgfplots Error: Sorry, could not retrieve column '[index]0' from > table '\loadedtable@@table@name '. Otherwise, with the code as above, the following is typeset in the output: ![test03.png](http://i.stack.imgur.com/VoeBR.png) ... and as the zero is printed twice, it is confirmed that the first one is actually a header. So, my question is - is there a way to dynamically create a table in `pgfplotstable` without a header row?


title: How to number a conditional equation

text: I am writing the following syntax to get a conditional equation. But the equation is not numbered. How can I number it?               \[      f(x) = \begin{cases}     x+7 & \text{if $5< x$}; \\     x^2-3 & \text{if $-3 \le x \le 5$};\\     -x & \text{if $x < -3$}.     \end{cases}     \]


title: Strange error with `thmtools` styling in a package

text: I'm writing a package. Here is a part of it which should be enough for people to try reproducing my problem:               %[…]     \ProvidesPackage{mworks}     %[…]     \RequirePackage{amsmath,amssymb,amsfonts,nicefrac}     \RequirePackage{multirow}     \RequirePackage{xparse}     \RequirePackage{thmtools,mathtools}     %[…]     \newif\ifmworks@thm\mworks@thmfalse     \DeclareOption{thm}{\mworks@thmtrue}     %[…]     \ProcessOptions\relax     %[…]     %Option "thm"     \ifmworks@thm     \newcommand{\setlistwidth}[1][4em]{\renewcommand\thmt@listnumwidth{#1}}     \newcommand{\thlist}{\listoftheorems}     \newcommand{\deflist}{\renewcommand\listtheoremname{Definizioni, Teoremi, Proposizioni, ecc.}     \listoftheorems[ignoreall,show={defi,teor,oss,propo,coro,fatto,lemma,pt,riass,es}]     \renewcommand\listtheoremname{Esercizi assegnati a lezione}     \listoftheorems[ignoreall,show={ese}]}     \newcommand{\changename}{\renewcommand\listtheoremname}     \declaretheoremstyle[     spaceabove=\topsep, spacebelow=\topsep,     headfont=\normalfont\bfseries,     notefont=\bfseries, notebraces={}{},     bodyfont=\normalfont\itshape,     postheadspace=0.5em,     name={\ignorespaces},     numbered=no,     headpunct=]     {mystyle}     \declaretheorem[style=mystyle]{@thmattr}     \ExplSyntaxOn     \NewDocumentEnvironment{xtheor}{moO{x}ooo}     {\renewcommand{\thmtformatoptarg}[1]{ #1}\IfNoValueTF{#2}           {\def\theorem@attr{#1}}           {\@ifundefined{c@#2}                 {\newcounter{#2} \setcounter{#2}{1}}                 {\addtocounter{#2}{+1}}           \def\counters{           \str_if_eq:nnTF{#3}{c}           {                 \arabic{chapter}.\arabic{#2}           }           {                       \str_if_eq:nnTF{#3}{s}                       {                             \arabic{chapter}.\arabic{section}.\arabic{#2}                       }                       {                             \str_if_eq:nnTF{#3}{x}                             {                                   \arabic{chapter}.\arabic{section}.\arabic{subsection}.\arabic{#2}                             }                             {                                   \str_if_eq:nnTF{#3}{n}                                   {                                   \arabic{#2}                                   }                                   {                                   \errmessage{Illegal argument in counter definition}                                   \errhelp{The third argument must be either c, s or x, for chapter, section and subsection respectively}                                   }                             }                      }}}\def\theorem@attr{#1\,\,\counters\IfValueTF{#4}{\,\,}{}}}                      \def\name@thmlist{\IfValueTF{#2}{\counters\,\,}{}#1\IfValueTF{#4}{\IfValueTF{#6}{\,\,#6}{\,\,#4}}{}}     \IfNoValueTF{#4}           {\begin{@thmattr}[{name=[\name@thmlist]\theorem@attr}]}           {\IfNoValueTF{#5}                 {\begin{@thmattr}[{name=[\name@thmlist]\theorem@attr (#4)}]}                 {\begin{@thmattr}[{name=[\name@thmlist]\theorem@attr (#4)},label=#5]}}}     {\end{@thmattr}}     \renewcommand\thmt@listnumwidth{-1.5em}     \ExplSyntaxOff     \newcommand{\e}[1][1]{     \qwerty=#1     \ifnum\qwerty>0         {\loop\!\advance\qwerty by -1\ifnum\qwerty>0\repeat}     \else         {\loop\,\advance\qwerty by 1\ifnum\qwerty<0\repeat}     \fi}     \fi     %[…]     \endinput      where the lines of `%[…]` are bits of package code I've believed to be useless for the purpose of this question and therefore left out. With the following code:               \documentclass[a4paper]{report}     \usepackage{amsmath,amssymb,amsfonts,mathtools,mathptmx}     \usepackage{xparse}     \usepackage[all]{mworks}          \begin{document}          \end{document}      run through XeTeX, I get:               This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013)      restricted \write18 enabled.     entering extended mode     (./MworksGreek.tex     LaTeX2e <2011/06/27>     Babel <3.9f> and hyphenation patterns for 78 languages loaded.     (/usr/local/texlive/2013/texmf-dist/tex/latex/base/report.cls     Document Class: report 2007/10/19 v1.4h Standard LaTeX document class     (/usr/local/texlive/2013/texmf-dist/tex/latex/base/size10.clo))     (/usr/local/texlive/2013/texmf-dist/tex/latex/amsmath/amsmath.sty     For additional information on amsmath, use the `?' option.     (/usr/local/texlive/2013/texmf-dist/tex/latex/amsmath/amstext.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/amsmath/amsgen.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/amsmath/amsbsy.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/amsmath/amsopn.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/amsfonts/amssymb.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/amsfonts/amsfonts.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/mh/mathtools.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/keyval.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/tools/calc.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/mh/mhsetup.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/psnfss/mathptmx.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3packages/xparse/xparse.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/expl3.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3names.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/etex-pkg/etex.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3basics.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3expan.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3tl.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3seq.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3int.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3quark.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3prg.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3clist.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3token.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3prop.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3msg.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3file.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3skip.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3keys.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3fp.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3box.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3coffins.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3color.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3luatex.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3kernel/l3candidates.sty)     (/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/ifpdf.sty)))     (./mworks.sty     Package `Mworks' <Mon 2014-04-01 >.     (/usr/local/texlive/2013/texmf-dist/tex/latex/units/nicefrac.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/base/ifthen.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/multirow/multirow.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thmtools.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-patch.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/parseargs.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-kv.sty     (/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty     (/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/infwarerr.sty)     (/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/etexcmds.sty     (/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))     (/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-autoref.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/aliasctr.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/carlisle/remreset.sty)))     (/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-listof.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-restate.sty))     (/usr/local/texlive/2013/texmf-dist/tex/generic/mathdots/mathdots.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/tools/multicol.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/fontspec/fontspec.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/fontspec/fontspec-patches.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/base/fixltx2e.sty)     *************************************************     * LaTeX warning: "xparse/redefine-command"     *      * Redefining document command \oldstylenums with arg. spec. 'm' on line 128.     *************************************************     ) (/usr/local/texlive/2013/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/base/fontenc.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/euenc/eu1enc.def)     (/usr/local/texlive/2013/texmf-dist/tex/latex/euenc/eu1lmr.fd))     (/usr/local/texlive/2013/texmf-dist/tex/xelatex/xunicode/xunicode.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/tipa/t3enc.def     (/usr/local/texlive/2013/texmf-dist/tex/latex/euenc/eu1lmss.fd))     (/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/graphicx.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/graphics.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/trig.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/latexconfig/graphics.cfg)     (/usr/local/texlive/2013/texmf-dist/tex/xelatex/xetex-def/xetex.def))))     (/usr/local/texlive/2013/texmf-dist/tex/latex/fontspec/fontspec.cfg)))     (/usr/local/texlive/2013/texmf-dist/tex/latex/xltxtra/xltxtra.sty     (/usr/local/texlive/2013/texmf-dist/tex/generic/ifxetex/ifxetex.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/realscripts/realscripts.sty     *************************************************     * LaTeX warning: "xparse/redefine-command"     *      * Redefining document command \textsubscript with arg. spec. 's' on line 25.     *************************************************     *************************************************     * LaTeX warning: "xparse/redefine-command"     *      * Redefining document command \textsuperscript with arg. spec. 's' on line 28.     *************************************************     ) (/usr/local/texlive/2013/texmf-dist/tex/latex/metalogo/metalogo.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/color.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/latexconfig/color.cfg))     (/usr/local/texlive/2013/texmf-dist/tex/latex/base/textcomp.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/base/ts1enc.def))     (/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/hyperref.sty     (/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty     (/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/auxhook.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/kvoptions.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/pd1enc.def)     (/usr/local/texlive/2013/texmf-dist/tex/latex/latexconfig/hyperref.cfg)     (/usr/local/texlive/2013/texmf-dist/tex/latex/url/url.sty))          Package hyperref Message: Driver (autodetected): hxetex.          (/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/hxetex.def     (/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/puenc.def)     (/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/stringenc.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))     (/usr/local/texlive/2013/texmf-dist/tex/latex/enumitem/enumitem.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/marginnote/marginnote.sty)          Package thmtools Warning: Your backend doesn't allow styling theorems on input      line 1142.               ./mworks.sty:1143: Package thmtools Error: \declaretheorem key `spaceabove' not      known.          See the thmtools package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.1143 \declaretheorem[style=mystyle]{@thmattr}      What does that mean and how can I fix it?


title: Can you add a constant value to a length macro?

text: I have a box that's the full width of the page. I would like to offset it back into the margin a little, but when I do that it no longer reaches the edge of the page. Is it possible to keep using a macro like `\textwidth` but add a constant value onto it?               \hspace{-5mm} % Go back into the margin a bit     \colorbox[gray]{0.85}{       \parbox{\textwidth}{  % Need \textwidth + 5mm to end up in the same place         Hello       }     }


title: LaTeX List of listings name in front of number

text: I am having problems with LaTeX specifically using `listings` package. The first one is I want to add the word "Código" in front of number of Listing in List of Listings. For example > **List of Listings** > > Código 1. function1.m ........... page 1 > > Código 2. Function2.m ........... page 2 And the second one is: If I use the option "title" in `\lstset`, these titles do not appear in the List of Listings but it do appear at the top of each listing. How can I make titles appear in the List of Listings?


title: How to run \IfSubStr on a macro parameter that may contain a newline

text: I have a macro where parameters may contain newlines but when one does, everything seems to break. How can I prevent this problem? I also want \IfSubStr to look for a match anywhere in the parameter string regardless of newlines. Here is an example:               \documentclass{scrartcl}     \usepackage{xstring}          \newcommand{\mytest}[8]{%                                                                                \IfSubStr{#1}{\#HIDE}{Hidden.}{#1}     }               \begin{document}          Four tests follow:          1. \mytest{Some string that is not hidden.}          2. \mytest{Another string that is not hidden.}          3. \mytest{Some string that is hidden.\#HIDE}          4. \mytest{A string that does not work and breaks everything because it has a newline\newline in it}          Tests completed.          \end{document}      Output I get with pdflatex is: Four tests follow: 1\. Some string that is not hidden. . Hidden. ests completed. I don't understand what is wrong with test 2 not printing either. And I can't use a [1] for the number of arguments to \mytest for some reason.


title: Tikz: Alignment of labels relative to a split rectangle

text: Is there a way for accurate placement of labels relative to the center of each of the parts of a split rectangle? The following example shows two errors:   * Alignment is with the left side of the sub-part   * The vertical alignment seems to be wrong. The following is a a minimal working example:                \documentclass{standalone}      \usepackage{tikz}      \usetikzlibrary{positioning,shapes.multipart}           \begin{document}      \begin{tikzpicture}[          date/.style= {            rectangle split,            rectangle split horizontal,             rectangle split parts=3,            draw        }]        \node[date] (today) {          \nodepart{one}   {\texttt{2014}}          \nodepart{two}   {\texttt{01}}          \nodepart{three} {\texttt{01}}        };        \node[below=2mm of today.one] {\texttt{y}};        \node[below=2mm of today.two] {\texttt{m}};        \node[below=2mm of today.three] {\texttt{d}};      \end{tikzpicture}      \end{document}      ![the above document when rendered](http://i.stack.imgur.com/ZeLgs.jpg)


title: Add additional text on title page

text: I want my title page to look like this                                               Title                                     Author                                     Date               Coordinator1                          Coordinator2                               Dept. of Physics                                 ABC College      If i put some text after \maketitle, it gets shifted to next page.How can i add this to same page ?Is there any way of doing this (except writing the whole title page on my own) ? Thanks in advance.....


title: Putting multiple columns from csv file into single column while printing the table using pgfplotstable

text: **Reference:** My question which was answered by Dr. Christian Feuersänger Link to the question.. This is a follow-up question. The MWE (Provided by Dr. Christian Feuersänger in his answer)               \documentclass{standalone}      \usepackage{pgfplotstable}     \begin{document}          \pgfplotstabletypeset[       col sep=comma,       columns/col1/.style={string type,column type=r},       columns/col2/.style={string type,column type=l},       columns/col3/.style={string type,column type=l},       ]     {         col1,col2,col3         Col A,B,C         The first column,E,F     }             \end{document}      ![enter image description here](http://i.stack.imgur.com/GFUx5.png) **Question:** How to get a table having only two columns with second column having the elements               col2/col3     B/C     E/F      In detail, the table should be like this:                   col1               col2/col3         Col A              B/C         The first column   E/F      How to get it using pgfplotstable?


title: Datatool and multiple files

text: I am trying to achieve the same goal as I tried with pgfplotstable as in this question for which I got good help from the author of pgfplotstable (Dr. Christian Feuersänger) himself. Hence this question may be considered to be of academic interest to me. I have two csv files: `names.csv`               Sl. No., Reg. No.,Name,Category,Group,Gate,Sponsored,Department     1,MS001,Ajay-D-Vimal Raj P,PY,OBC,--,No,Physics     2,MS002,Harish Kumar,PY,GE,GATE,Yes,Physics     3,MS003,Ajay-D-Vimal Raj P,PY,OBC,--,No,Physics     4,MS004,Harish Kumar,PY,GE,GATE,Yes,Physics      and `marks.csv`               number,marks     MS001,67     MS002,25     MS003,62     MS004,55      **Requirement:** I want to print the first file (`names.csv`) into a long table in which, I would like to include the second column (i.e., marks column) of `marks.csv`, as the column coming after the names column (i.e., as the fourth column). Here is the MWE (working, but not as I desired)               \documentclass[10pt]{article}     \usepackage[a4paper,margin=2cm]{geometry}     \usepackage{longtable}     \usepackage{datatool}     % \usepackage{filecontents}     %     % \begin{filecontents}{names.csv}     % serial,number,name,group,category,gate,sponsored,dept     %     1,MS001,Ajay-D-Vimal Raj P,PY,OBC,--,No,Physics     %     2,MS002,Harish Kumar,PY,GE,GATE,Yes,Physics     %     3,MS003,Ajay-D-Vimal Raj P,PY,OBC,--,No,Physics     %     4,MS004,Harish Kumar,PY,GE,GATE,Yes,Physics     % \end{filecontents}          % \begin{filecontents}{marks.csv}     %     number,marks     %     MS001,67     %     MS002,25     %     MS003,62     %     MS004,55     % \end{filecontents}     %     \begin{document}     \DTLloaddb{names}{names.csv}     \DTLloaddb{marks}{marks.csv}                            % ----------------------------------------------------------------------%     % ----------------------------------------------------------------------%     {\small     \begin{longtable}{|c|l|p{3.5cm}|c|l|c|c|c|c|}\hline     % -----------------These are headings----------------------------------%     \textbf{} & \textbf{Reg. No.} &  \multicolumn{1}{c|}{\textbf{Name}} & \textbf{Marks}&     \multicolumn{1}{c|}{\textbf{Category}}  & \textbf{GATE} & \textbf{Sponsored} &\textbf{Department} \\ \hline     %     \endfirsthead     %     \multicolumn{8}{c}%     {{\bfseries  Continued from previous page}} \\     \hline     %     \textbf{} & \textbf{Reg. No.} & \multicolumn{1}{c|}{\textbf{Name}} & \textbf{Marks}&     \multicolumn{1}{c|}{\textbf{Category}}  & \textbf{GATE} & \textbf{Sponsored}&\textbf{Department} \\ \hline\hline     \endhead     %     \hline \multicolumn{8}{|r|}{{Continued on next page}} \\ \hline     \endfoot     %     \hline     \multicolumn{8}{|r|}{{Concluded}} \\ \hline     \endlastfoot     %-----------Headings end---------------------------------     %--------------------------table body starts-------------------     \DTLforeach{names}{%     \sl=serial, \reg=number,\name=name, \group=group, \category=category, \gate=gate,\sponsored=sponsored,\dept=dept}{%     \DTLiffirstrow{}{\\\hline}%       % \DTLiflastrow{\dtlbreak}{}     % \DTLiffirstrow{\dtlbreak}{}      \DTLforeach{marks}{%      \marks=marks}{%      \DTLiffirstrow{}{\\}%     %  \DTLiffirstrow{\dtlbreak}{}     % \DTLiflastrow{\dtlbreak}{}     \sl & \reg & \name & \marks & \group/\category & \gate & \sponsored & \dept     %     }%     }%     %--------------------------table body ends-------------------     \end{longtable}     }%     %     \end{document}      ![enter image description here](http://i.stack.imgur.com/rP5hV.png) But somehow I am not able to get the looping correct and every name is repeated 4 times. **Questions:**   1. How to get the corresponding mark from `marks.csv` file and print it. (get the `\DTLforeach` correctly?)   2. How to sort the resulting table in the increasing order of marks while keeping only the serial numbers in the first column untouched. (All other columns should be sorted as per their corresponding marks)? Any more clarifications will be gladly obliged.


title: Filling white space in title page with random numbers or a text

text: Is it possible to fill all white space in this template with numbers or a text? ![](http://i.stack.imgur.com/lo8gM.jpg)               %----------------------------------------------------------------------------------------     %   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS     %----------------------------------------------------------------------------------------          \documentclass[10pt]{article}          \usepackage[a4paper,pdftex]{geometry}   % Use A4 paper margins     \usepackage[english]{babel}     \usepackage{xcolor} % Required for specifying custom colors     \usepackage{fix-cm} % Allows increasing the font size of specific fonts beyond LaTeX default specifications          \setlength{\oddsidemargin}{0mm} % Adjust margins to center the colored title box     \setlength{\evensidemargin}{0mm} % Margins on even pages - only necessary if adding more content to this template          \newcommand{\HRule}[1]{\hfill \rule{0.2\linewidth}{#1}} % Horizontal rule at the bottom of the page, adjust width here          \definecolor{white}{rgb}{255,255,255} % Color of the box surrounding the title - these values can be changed to give the box a different color            \begin{document}          \thispagestyle{empty} % Remove page numbering on this page          %----------------------------------------------------------------------------------------     %   TITLE SECTION     %----------------------------------------------------------------------------------------          \colorbox{white}{         \parbox[t]{1.0\linewidth}{             \centering \fontsize{50pt}{80pt}\selectfont % The first argument for fontsize is the font size of the text and the second is the line spacing - you may need to play with these for your particular title             \vspace*{0.7cm} % Space between the start of the title and the top of the grey box                  \hfill \LaTeX \\             \hfill Title \\             \hfill Template\par                  \vspace*{0.7cm} % Space between the end of the title and the bottom of the grey box         }     }          %----------------------------------------------------------------------------------------          \vfill % Space between the title box and author information          %----------------------------------------------------------------------------------------     %   AUTHOR NAME AND INFORMATION SECTION     %----------------------------------------------------------------------------------------          {\centering \large      \hfill John Smith \\     \hfill University Name \\     \hfill Department Name \\     \hfill \texttt{http://www.johnsmith.com} \\          \HRule{1pt}} % Horizontal line, thickness changed here          %----------------------------------------------------------------------------------------          \clearpage % Whitespace to the end of the page          \end{document}      @egreg If i put the numbers manually i get the overfull hbox error and the number are put in a line and i have not the filling of the sheet. Like this:               \documentclass{article}     \usepackage[a4paper,top=0pt,bottom=0pt,left=1.5pt,right=1.5pt]{geometry}     \input{random}          \def\print{\expandafter\printaux\number\randomi\relax}     \def\printaux#1{\ifx#1\relax\else#1\hskip0pt plus .1pt\relax\expandafter\printaux\fi}          \begin{document}          \baselineskip=12.05pt     \parindent=0pt     \flushbottom     \enlargethispage{20\baselineskip}          5405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054541635454054163545405416354540541635454054163546354540541635454054163545405416354540541635454054163545405416354540546354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354     \end{document}


title: Macro to access a specific member of a list

text: I want to be able to have a macro access a specific element of a list. The following code works, however requires me to have two separate macros: one that accepts a list, and the other that accepts the name of a macro that contains the list.               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{xstring}          \begin{document}          \newcommand*{\GetListMemberA}[2]{%         \foreach \a [count=\i] in {#1} {%             \IfEq{\i}{#2}{\a\breakforeach}{}%         }%         \par%     }%          % This is same as above except does not have {} around #1     \newcommand*{\GetListMemberB}[2]{%         \foreach \a [count=\i] in #1 {%             \IfEq{\i}{#2}{\a\breakforeach}{}%         }%         \par%     }%               \newcommand*{\MyList}{a1,b2,c3,d4,e5}%          % These work if the foreach uses {#1} (ie, with the curly braces)     This should print "b": \GetListMemberA{a,b,c,d,e}{2}%     This should be blank: \GetListMemberA{a,b,c,d,e}{6}%          % These work if the foreach uses #1 (ie, without the curly braces}     This should be "a1": \GetListMemberB{\MyList}{1}%     This should be "c3": \GetListMemberB{\MyList}{3}%     This should be blank: \GetListMemberB{\MyList}{6}%          \end{document}      This question on TikZ \foreach loop with macro-defined list suggest to remove the braces around the macro when using a foreach, and that is how I was able to come up with this solution. So, how can I change this so I don't have to have two macros? I don't think this issue is related to Using Macro Defined Lists in TikZ/PGFplots as that was specific to lists used to label tick marks on axis.


title: theindex + hyperlink page problem

text: Have really nowbody an idea? I don't find still yet a solution. This code works. My Problem is the references doesn't appear in table of contents. I write following               \clearpage     \phantomsection     \addcontentsline{toc}{chapter}{References}      after printindex and notice it has no effect. Then I put it before printindex and then the references appears in table of content, but the pagenumber and the hyperlink is wrong. Have anybody an Idea what do I wrong?               \documentclass{book}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[ngerman]{babel}     \usepackage[makeindex]{splitidx}     \usepackage{nomencl}     \usepackage{hyperref}          \usepackage{etoolbox}     \makeatletter     \patchcmd{\theindex}     {\@makeschapterhead}     {\phantomsection     \addcontentsline{toc}{chapter}{\indexname}%     \@makeschapterhead}     {}{}     \makeatother               \newcommand{\ITerm}{IndexTerms}     \newcommand{\IServ}{IndexServs}     \newcommand{\MyLarge}{\Large}     \newcommand{\smindexxspecial}[2]{{\MyLarge#2} \sindex[#1]{#2}}     \newcommand{\smindexspecial}[2]{{\MyLarge#2}\sindex[#1]{#2}}     \newcommand{\smindexvspecial}[2]{{\MyLarge#2}\sindex[#1]{#2}}     \newcommand{\smsindexspecial}[2]{{\MyLarge \url{#2}}\sindex[#1]{#2}}          \makenomenclature     \newindex[General Index]{IndexTerms}     \newindex[Websites]{IndexServs}          \begin{document}          \smindexspecial{\ITerm}{blabla}     (\smsindexspecial{\IServ}{www.wikipedia.com})     \nomenclature{bla}{bla}          \tableofcontents               %other things they go to tableofcontent too          \backmatter     \cleardoublepage     \phantomsection     \addcontentsline{toc}{chapter}{Nomenclature}     \printnomenclature[3,0 cm]          \printindex[IndexTerms]          \printindex[IndexServs]          \clearpage     \phantomsection     \addcontentsline{toc}{chapter}{References}               And this is the end of the story.     \end{document}


title: Finding centroid of the content in whole tikzpicture, scope or node

text: Does TikZ allow moderately easy implementation of finding centroid of the content in tikzpicture, scope or node? Could you show it? Let's say the only assumption is intuitive one, that each 1pt dot has some unit weight. For simple drawings, like triangle, filled triangle, etc. it is easy to find it manually, but some help of TikZ in more complex cases (many circles with unequal radii [results are obviously different if these circles are filled], etc) would be appreciated. _Side note_ : There is no point (usually) in considering mixed drawings (filled and not filled in one picture), so solutions can (and, if at all, possibly will) be different for filled and path-only drawings. Universal solution would be the best, though. ### Example using Ryan's solution I couldn't resist and do not give my own example. Sorry!               \documentclass{minimal}     \usepackage{tikz}     \usepackage[a5paper,margin=16mm,top=4cm]{geometry}     \usetikzlibrary{decorations.markings,scopes}     \newcommand\globallist[2]{\global\edef#1{#1#2}}     \tikzset{bary markings/.style = {         decoration = {             markings,             mark = between positions 0 and 1 step .1 with {                 \edef\number{\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}}                 \coordinate (r\number);                 \globallist\refpoints{r\number=1,}             }         },         postaction = {decorate}     }}     \def\refpoints{}     \def\docentroid{         \coordinate (fake) at (5,0);         \globallist\refpoints{fake=0}         \draw[fill] (barycentric cs:\refpoints) circle (2mm);         \global\def\refpoints{}     }     \begin{document}     \pagestyle{empty}     \begin{tikzpicture}[y=3mm, x=3mm, yscale=-1, inner sep=0pt, outer sep=0pt]         \draw[bary markings]             (161.8225,329.7121) .. controls (156.5960,329.7121) and             (152.9749,330.3097) .. (150.9593,331.5050) .. controls (148.9436,332.7004) and             (147.9358,334.7394) .. (147.9358,337.6222) .. controls (147.9358,339.9191) and             (148.6858,341.7472) .. (150.1858,343.1066) .. controls (151.7092,344.4425) and             (153.7717,345.1105) .. (156.3733,345.1105) .. controls (159.9592,345.1105) and             (162.8303,343.8449) .. (164.9866,341.3136) .. controls (167.1663,338.7589) and             (168.2561,335.3722) .. (168.2561,331.1535) -- (168.2561,329.7121) --             (161.8225,329.7121)(174.7249,327.0402) -- (174.7249,349.5050) --             (168.2561,349.5050) -- (168.2561,343.5285) .. controls (166.7795,345.9191) and             (164.9397,347.6886) .. (162.7366,348.8371) .. controls (160.5335,349.9621) and             (157.8381,350.5246) .. (154.6507,350.5246) .. controls (150.6194,350.5246) and             (147.4085,349.3996) .. (145.0179,347.1496) .. controls (142.6507,344.8761) and             (141.4671,341.8410) .. (141.4671,338.0441) .. controls (141.4671,333.6144) and             (142.9436,330.2746) .. (145.8968,328.0246) .. controls (148.8733,325.7746) and             (153.3030,324.6496) .. (159.1858,324.6496) -- (168.2561,324.6496) --             (168.2561,324.0168) .. controls (168.2561,321.0402) and (167.2717,318.7434) ..             (165.3030,317.1261) .. controls (163.3577,315.4855) and (160.6155,314.6652) ..             (157.0764,314.6652) .. controls (154.8264,314.6652) and (152.6350,314.9348) ..             (150.5022,315.4738) .. controls (148.3694,316.0129) and (146.3186,316.8215) ..             (144.3499,317.8996) -- (144.3499,311.9230) .. controls (146.7171,311.0090) and             (149.0139,310.3293) .. (151.2405,309.8839) .. controls (153.4671,309.4152) and             (155.6350,309.1809) .. (157.7444,309.1808) .. controls (163.4397,309.1809) and             (167.6936,310.6574) .. (170.5061,313.6105) .. controls (173.3186,316.5637) and             (174.7248,321.0402) .. (174.7249,327.0402);         \docentroid     \end{tikzpicture}     \end{document}      ![centroid of letter "a"](http://i.stack.imgur.com/h36Mo.png)


title: Alignment of material across pages

text: How would you make two corresponding lists on two different pages so that the corresponding items in the two lists would be at the same absolute height on the two pages? I guess the best way to explain the sort of thing I'm looking for is through an example. One middle school math contest, MATHCOUNTS, does this for their question and answer pages (sometimes). See https://mathcounts.org/Page.aspx?pid=295. Open the 2011 State Competition Sprint Round and 2011 State Competition Answer Key pdfs. You will notice that on the answer key, the answers are spaced so that if a student's completed test and the answer key are lined up side by side, the lines will match up for easy grading. I don't even know how to begin... thanks.


title: TikZ Fading Speed

text: In the fading example at TikZ examples I would like to change the "speed" at which fade occurs. In fact I would like it to be very "sharp" so that in the square examples you basically will see about half a square because it fades out so quick. Any ideas how to achieve that? (basically I want to overlay two squares with different colors and end up seeing half a square of one color and the other half the other color but with a sort of quick fade between the two in the center(instead of the gradual fade that the default tikz setup gives)


title: How can I eliminate the vertical extra space before and after the proof-environment?

text: consider the following code:               \documentclass{scrartcl}     \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{enumerate}          \theoremstyle{plain}     \newtheorem{thm}{Theorem}     \theoremstyle{definition}     \newtheorem{rmk}[thm]{Remark}               \begin{document}          \begin{thm}     Normal theorem.     \end{thm}     \begin{proof}     Normal proof.     \end{proof}          %%%%%%%%%%%%%%%%%%%%%%          \begin{rmk}     \begin{enumerate}[(a)]     \item Some remark.     \begin{proof}     Proof for that remark. %!!!     \end{proof}     \item Other information.     \end{enumerate}     \end{rmk}               \end{document}      I want to introduce (best via `newenvironment`) a new kind of proof environment that I can use for remarks and that does not have additional vertical space before and after the proof other than the usual vertical line spacing. So, the above example looks like ![enter image description here](http://i.stack.imgur.com/2qyFA.png) and I want to get rid of the extra space around the second `Beweis`.


title: Set length to the line height of a particular font

text: How to define new length using :               \newlength{...}     \setlength{...}{...}      and equal to the line height of a particular font (for example `\tiny\ttfamily`) Note : I want a solution which does not involve writing anything in the `\begin{document}\end{document}` part.


title: what is the [count=\i] in \foreach for?

text: Can someone explain what does `[count=\i]` in a `foreach` mean? Antal S-Z's answer to Fitting a list of points with TikZ and it's \foreach use this. It is also mentioned in Increment loop variable in inner foreach loop, but I am not able to locate documentation on this in the TikZ-PGF manual (V2.10)


title: Uncovering lines in an equation in split environment

text: How does one uncover lines in a multi-line equation one by one? I have taken a careful look at the answers provided here. It hasn't solved my problem. For example, my equation is the following and I want to uncover the two lines one at a time. Any help would be greatly appreciated.               \documentclass{beamer}     \usepackage{amsmath, amsfonts, amssymb, cancel}     \begin{document}     \begin{frame}     \frametitle{Steady State Relationship between $O^m, O^a$}     \begin{equation}     \begin{split}     (\rho +\sigma\bar\omega^m)O^m&=O^a-\phi L^a-\phi L^r-\eta O^r\\     \frac{O^m}{O^a}&=\frac{1-\phi l^a-(\phi l^r+\eta) O^r/O^a}{\rho +\sigma\bar\omega^m}     \end{split}     \end{equation}     \end{frame}     \end{document}


title: Using patterns inside pgf shapes

text: Is it possible to (correctly) use patterns inside a pgf shape definition ? For example, I try to define a shape as a rectangle filled with a pattern, like this               \usetikzlibrary{patterns}          \pgfdeclareshape{test shape}     {       \inheritsavedanchors[from=rectangle]       \inheritanchor[from=rectangle]{center}            \backgroundpath       {         \pgfsetfillpattern{north east lines}{.}         \pgfpathrectanglecorners{\pgfpoint{0}{0}}{\pgfpoint{1cm}{1cm}}         \pgfusepath{fill}       }     }      the problem is that `\pgfsetfillpattern` needs a color argument :               \pgfsetfillpattern{pattern name}{pattern color}      I want this color to be the color used to draw paths, so I tried to use `.` (the current color in the `xcolor` package). It doesn't work as expected :               \begin{tikzpicture}     \node[draw=red,test shape] at (0,0) {};     \node[fill=red,test shape] at (2cm,0) {};     \node[color=red,test shape] at (4cm,0) {};     \end{tikzpicture}      produces two black shapes and a red one : ![two rectangles filled with a black north east lines pattern and then a red one](http://i.stack.imgur.com/EO36K.png) I would expect the first one to be red too. So I have two questions   * is it an easy solution to do it ?   * is it a good idea to use patterns inside a pgf shape ? (And if the answer is no, well, why and what to do instead ?)


title: Redefining quote environment with tiny font and double quote signs?

text: I want to redefine the `quote` environment in such a way to get the output of the following code.               \begin{quote}{\tiny\textquotedblleft Text \textquotedblright}\end{quote}      I also want to fix the line spacing because the distance between the lines looks so wide.