title: Positioning of a (newly defined) symbol *relative* to a textbox

text: I defined a set of chevrons with tikz (see below) and would like to be able to put them at the boundary of a rectangle (text box). As you can see, the code below does this, but with absolute positioning of the chevrons. I don't mind working with `xshift` and `yshift`, but -- ideally -- _relative_ to the textbox's, say, upper left corner. How can this be done? Since I have several chevrons it would be good if the solution allowed to define them as a command which is invoked once the chevrons are used; but that's not so important.               \documentclass[pagesize]{article}     \usepackage[T1]{fontenc}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}[remember picture, overlay]       \node[anchor=east] at (current page.east)[rectangle, fill, inner sep=6mm, color=gray!20]{% text box         \color{red}\LARGE Some text here       };%       \foreach \x in {0, 3.8} \fill[color=blue, xshift=112mm, yshift=-92mm,       scale=0.04](0+\x,0)--(2+\x,0)--(4.7+\x,3.8)--(2+\x,7.6)--(0+\x,7.6)--(2.7+\x,3.8)--(0+\x,0);% chevrons     \end{tikzpicture}     \end{document}


title: How to create a table with a headline centered and columns centered?

text: I use the following code to create a table with a centered headline.               \begin{tabularx}{\textwidth}{l|X}       \multicolumn{2}{c}{Headline centered} \\       \hline       Column1 & Column2 which should be centered     \end{tabularx}      Now I would like to center the second column, too. But the `tabularx` package needs at least one column to be `X` and this column will not be centered. How can I achieve this ?


title: How to calculate and use the ratio of two lengths?

text: I want to calculate the ratio of two lengths in Latex, so that I can then stretch an en dash by that ratio. For example, in the code below, I'd like to replace the "0.7" value of FakeStretch with the ratio of newdashw/dashw. How can I do this?               \documentclass{article}     \usepackage{fontspec}     \setmainfont{TeX Gyre Schola}  % the font might change from doc to doc          \def\hairspace{\kern .08333em} % make a very thin space          \newlength\dashw     \settowidth\dashw{\normalsize--} % width of en dash in this font          \newlength\newdashw     \setlength\newdashw\dashw     \addtolength\newdashw{-0.16667em} % subtract 2*hairspace          % make a figure dash: want to replace "0.7" with "newdashw / dashw"     \newcommand\figdash{%         \hairspace{\addfontfeature{FakeStretch=0.7}--}\hairspace}          \begin{document}     Jenny's number: 867\figdash 5309     \end{document}


title: Precompiled header with lualatex and unicode-math

text: Consider the following: preamble.tex:               \documentclass{article}     \usepackage{unicode-math}     \setmathfont{Cambria Math}     \def\preambleloaded{Precompiled preamble loaded.}      main.tex               \def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax} \ifundefined{preambleloaded}     \typeout{PRECOMILED PREAMBLE NOT LOADED}\input{preamble} \else     \typeout{\preambleloaded}     \fi          \begin{document}     test test test     \end{document}      Now I use `lualatex -ini -job-name="main" "&lualatex preamble.tex\dump"` via the command line with the result of, apparently, an unfinished run (the corresponding logfile ends with               Beginning to dump on file main.fmt      (format=main 2014.9.11)     24193 strings using 403578 bytes     919997 memory locations dumped; current usage is 243&455843     22307 multiletter control sequences     \font      ). Subsequently the use of `lualatex -shell-escape "&main main.tex"` results in an error of the form of               This is LuaTeX, Version beta-0.76.0-2013062821 (rev 4627)     \write18 enabled     Could not undump 1 4-byte item(s): <fd:3>: unexpected end of file      The use of, e.g., Asana Math leads to the same error. I have an up-to-date MikTeX System and I use Cambria Math routinely with unicode-math, so I guess the font cannot be installed completely wrong. Am I doing something wrong? To be honest, I'm completely clueless. Any help greatly appreciated! :-)


title: Essay Formatting

text: I have an essay I need to write and I would like to use MacTeX, however it has been very challenging to get it formatted to all of my prof.'s requirements. If someone could help that would be SO helpful as I am still fairly new to LaTeX, but I would like to get better. The formatting needed is below. **Formatting guidelines:** Times 12-point font Double-spaced Put name and date in single space at top of page Put last name and page # in header section of following pages


title: Where should I put LaTeX macro package files?

text: I'm preparing to submit an article to one of Springer's journals. It requires to use Springer's LaTeX macro package. (http://www.springer.com/statistics/journal/10985 --> Instruction for authors --> Text) I downloaded the package and unzipped it. It includes readme.txt, Users Guide, template.tex and some .bst, .clo, .cls files. Where should I put these files to use this package? I'm using TeX Live 2013, so browsed c:/texlive/2013 and all its subfolders, but have no idea where I should put the files. This is for Windows of my home computer but I also use Mac at school, so I need answers for both Windows and Mac.


title: \label and \ref are different

text: When I used in theorem environment, I found that `\ref{}` didn't point to what I labeled. For example, I used `\label{1.1.1}` and `\ref{1.1.1}`, but it turned out to be `Theorem 1.1.` I don't know why? Anybody hep me? Thanks.               \documentclass{book}          \usepackage{amsmath}          \usepackage{amsthm}          \newtheoremstyle{plain}            {\topsep}   % ABOVESPACE            {\topsep}   % BELOWSPACE            {\itshape}  % BODYFONT            {0pt}       % INDENT             {\bfseries} % HEADFONT            { }         % HEADPUNCT            {5pt plus 1pt minus 1pt}             {\thmname{#1}~\thmnumber{#2}\thmnote{(#3)}}          \newtheorem{theorem}{Theorem}               \begin{document}          \chapter{}          \section{Word}          \begin{theorem}\label{1.1.1}This is good.          \end{theorem}          By theorem (\ref{1.1.1}), this word is also good.          \end{document}


title: Headings in uppercase

text: I want to write the headings in `\scshape` family with the first character of each word in uppercase. How can I do this?


title: Inserting .ps file into .tex file (texshop)

text: I have not been able to find the solution in other questions. I only want to insert a .ps figure into my tex file. I use `\usepackage{graphicx}` and write:               \begin{figure}[htbp]     \begin{center}       \includegraphics[width=0.9 \textwidth]{tree.ps}       \caption{Issue Dates and Postponement Options  of Hybrid Bonds}\label{}       \end{center}       \footnotesize{Note: This figure exhibits the number of hybrid bond issues and the number of postponement options by quarter. Source: Dealogic, Bloomberg, and company websites. }     \end{figure}      And I get an error saying .ps is not recognized. Is there an easy fix? Many thanks!


title: quickly changing all the file paths in a .tex file

text: I use a `.tex` file that I sync with Dropbox across two computers, - mac (running win 7) and a pc. The problem is that the `.tex` file is large, and contains a lot of tex commands (even user-written ones) like: `\addbibresource{D:/Gdrive/Drop/Dropbox/latex/main/my.file.tex}` Of course, this is the absolute path on my PC and the same file on my mac looks like: `\addbibresource{C:\Dropbox\latex\main\my.file.tex}` Note how `/` are changed in `\` and how the path is different. My question is: how can I simply (and quickly) change all the paths when I move from my pc to my mac and vice versa? I use the latest winedt version to edit my latex file. Many thanks for your help!


title: Delete page numbering within \begin{sidewaysfigure} environment

text: I have a sideways figure that takes up one whole page. Since it is a table, I don't want the page numbering to show in my case on the top of the table. If I include the commands `\thispagestyle{empty}` and `\clearpage` the page numbering of the previous page is deleted, no matter if I put it before or after the sideways figure. Putting the two commands within the sideways figure is not allowed. It is also important that the table remains a float. So I use a header to show the page numbering:               \begin{document}          \fancyhead{}     \rhead{\thepage}     \lhead{}     \pagestyle{fancy}          \begin{sidewaysfigure}     \begin{center}     \includegraphics[angle=360, trim=4cm 2cm 2cm 0cm, scale=1]{TechnCoeffMatrix.pdf}     \captionof{table}{Technical Coefficient Matrix} \label{tab:Technical Coefficient Matrix}     \end{center}     \end{sidewaysfigure}     \end{document}      So for the page with the \sidewaysfigure, the page number is shown at the bottom. Is it possible to delete this?


title: Simple Key Events table

text: Consider the simple time-line table shown in the image below (extracted from a book). ![enter image description here](http://i.stack.imgur.com/Y8tcJ.jpg) and the MWE below defining it as an environment,               \documentclass[twocolumn,10pt]{article}     \usepackage{mathpazo,calc,tikz}     \usepackage{xcolor}     \usepackage{lipsum}     \usepackage{microtype}     \usepackage{array,booktabs,colortbl}     \color[gray]{.1}     \makeatletter     \newif\if@top     \@toptrue     \if@top \def\one{\leavevmode\par}\def\two{\vfill}\fi     \newif\if@center     \if@center\def\one{\vfill}\def\two{\vfill}\fi     \newif\if@bottom     \@bottomtrue     \if@bottom\def\one{\vfill}\def\two{}\fi               \makeatother     \newenvironment{timeline}[1][1534--40]{%         \one         \long\def\Row##1##2{\rowcolor{yellow!8}[5pt][2pt]\textbf{##1}&##2 \\ \midrule}%         \setlength{\tabcolsep}{0pt}%         \arrayrulecolor{yellow}%         \renewcommand{\arraystretch}{1}%         \sffamily         \noindent         \newlength\templength         \settowidth{\templength}{#1}%         \addtolength{\templength}{1em}%             \begin{tabular}{p{\templength}p{\dimexpr\columnwidth-\templength-2pt}}%                  \hline                  \multicolumn{2}{>{\columncolor{yellow!25}[5pt][3pt]}l}{\bfseries KEY EVENTS}\\                  \hline}%            {\end{tabular}%            \two\vspace{-6.5pt}     }     \begin{document}     \lipsum[1-5]          \begin{timeline}       \Row{1520}{Death of Raphael. His later works were considered the beginning of Mannerism}       \Row{1528}{Sack of Rome. Spreads Mannerism across Italy and France}       \Row{c.\thinspace1528}{Jacobo Pontomo finishes his \textit{Deposition}, a Florentine altarpiece in the Mannerist style}       \Row{1534--40}{Girolano Parmigiano paints \textit{The\newline Madonna of the Long Neck}}       \Row{1541}{Birth of El Grego}     \end{timeline}          \end{document}      Can you assist in getting it closer to the original? Two generic issues, the background color around the _Key Events_ heading, blending as a frame around the rows, and the second one removing the additional space at the bottom to line it with the baseline of the left column text (manually corrected in the MWE). There are also other minor differences. ![enter image description here](http://i.stack.imgur.com/inLMh.jpg) It is probably better to view the style in context from the book _Art_ by Robert Cumming, published by DK Publications. ![enter image description here](http://i.stack.imgur.com/1BFlR.jpg)


title: Include trimmed multipage PDF in XeTeX

text: I have a multipage PDF manuscript (for example, `my_PDF.pdf`) that I would like to include in a new document. I would also like to trim/clip off the header and footer from each page of this included pdf. In the past, with regular LaTeX, I have done this very simply with something like               \documentclass[letterpaper]{article}     \usepackage{pdfpages}          \begin{document}         \includepdf[pages={1,2},trim=0.45in 0.625in 0.45in 0.625in, offset=0.25in 0in, width=6in, clip=true, pagecommand={}]{my_PDF}     \end{document}      as described at http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics. However, this time I need to do it in XeTeX for Unicode support, and the above method doesn't work because clipping isn't supported yet in XeTeX. I've managed to come very close by using the nice `adjustbox` package, which lets you (almost) transparently redefine the `\includegraphics` macro in a way that supports clipping:               %!TEX TS-program = xelatex     %!TEX encoding = UTF-8 Unicode          \setlength{\pdfpagewidth}{8.5in} % Something wrong with my compiler setup     \setlength{\pdfpageheight}{11in}          \documentclass[letterpaper]{article}     \usepackage{pdfpages}     \usepackage[Export]{adjustbox}          \begin{document}         \includepdf[pages={1,2},trim=0.45in 0.625in 0.45in 0.625in, offset=0.25in 0in, width=6in, clip=true, pagecommand={}]{my_PDF}     \end{document}      But now I'm stuck again because it doesn't seem the `\adjustbox` way can select different pages in the multipage PDF (i.e. this second code example repeatedly inserts the same properly-trimmed first page). Is there a way to make this work? Maybe I'm missing a way to select the pages? Or somehow use the original way to insert the pages, in combination with some sort of `pagecommand={\adjustbox{...}}` key to the `\includepdf` macro? (I tried this too, but I am a relative novice and couldn't get it going) Perhaps there's a totally different method that I'm missing. Basically, I just want to be able to insert a cropped/trimmed multipage PDF document inside an XeTeX document.


title: GIF/SWF animation embedded in LaTeX document (PDF)

text: There seem to be plenty of resources for how to do it (even on this website), but I'm struggling with the process. Can someone provide a link to an **example** pdf with the working animations in it? The only I see have buttons and are interactive (but aren't working on my machine anyway)-- what I would like is even simpler, just a looping gif file that never stops (I'm trying to show the evolution of a system, against certain parameters and time). Thanks for any examples.


title: Is there any way to include an animated GIF directly?

text: Is there any way to include an animated GIF directly in either PDFLaTeX or XeLaTeX? I realize the `animate` package can include animations in a PDF, but it doesn't support animated GIFs and you have to split them up manually into EPS or PNG files as far as I can tell.


title: Dynamically calculate fitter in TikZ

text: I'm creating a command for automatic generation of resources and deadlocks through TikZ. I have the following code that works correctly:               \usetikzlibrary{shapes,positioning,fit}     \begin{tikzpicture}     \tikzset{       proc/.style={draw,circle},        res/.style={rectangle,draw,minimum height=2.5em, minimum width=2.5em},        resi/.style={circle, inner sep=0.1em,circle,draw,node distance=0.5em},     }     \newcommand{\drawressingle}[2]{%       \node  (#1l) {#2};       \node [resi,below=0.15em of #1l] (#1i1) {};     }     \newcommand{\drawres}[4]{%       \ifx&#4&\tikzstyle{placeres}=[];%       \else\tikzstyle{placeres}=[#4];\fi%            \node [placeres] (#1l) {#2};       \node [resi,below=0.15em of #1l] (#1i1) {};       \foreach \i in {2,...,#3}{         \pgfmathtruncatemacro{\h}{\i-1}           \node [resi,below=of #1i\h] (#1i\i) {};       }     }          \drawressingle{r1}{R1}{}     \drawres{r2}{R2}{2}{left=of r1l}     \drawres{r3}{R3}{5}{right=of r1l}     \end{tikzpicture}      What I want to do is create a new node that is basically a rectangle around all of the nodes called e.g. r1i1, r1i2, .... What I will need is something that can generate the following if the first param is `r1` and the third param is `3`:               \node[fit=(r1i1)(r1i2)(r1i3)] {};      I can't think of a way to loop over and generate the above.


title: pgfplotstabletypeset merged cells in middle of table

text: I have to convert some `*.doc` files in LaTex and I have some hard work with converting some tables. I have, for example, tables like this: ![Merged cells](http://i.stack.imgur.com/XoFDx.png) and is **mandatory to import the values from`*.csv` file**. It's easy when I have the same number of columns on all the rows but I can't get to make it work for merged cells. How could I do this? And how should the data in the `csv` file look? P.S. I have to use `pgfplotstabletypeset`, but if not possible I can use other methodes. Edit: the `cvs` file looks likes:               nr;ABC;test1;test2;test3;test4;test5          1;abc1;q;w;e;r;t          2;abc2;Test**;**;**;**;**          3;abc3;**;**;**;**;**;**          4;abc4;**;**;**;**;**;      and the cells with `**` should be merged. I don't know if this is possible ...


title: How to include multiple \Sexpr values within LaTeX math mode tags?

text: As part of my work, I am expected to show calculation steps with sample values. To do this, I usually just replace the variable names with \Sexpr{} to add in the values. For some reason \Sexpr{} escapes math mode and breaks some of my tags. For instance, this works well:               $r_{pump} = \sqrt{(x_{pump} - x_{obs})^{2} + (y_{pump} - y_{obs})^{2}}$       It results in all values being correctly placed under the square root tag like this: ![\[Correct Square Root tagging image here\]\(http://i.imgur.com/PxtfZjw.png\)](http://i.stack.imgur.com/kZdK2.png) However, when I try to include \Sexpr{} tags to incorporate values like this...               $\sqrt{(\Sexpr{x[1]}(m) - \Sexpr{x[2]}(m))^{2} + (\Sexpr{y[1]}(m) - \Sexpr{y[2]}(m))^{2}}$      ...I get results that look like this: ![enter image description here](http://i.stack.imgur.com/Z1NFh.png) This happens when I try to include \Sexpr{} in a \frac{}{} tag as well. Am I applying math mode ($\Stuff$) incorrectly?


title: Problems with glossaries package and complex symbols

text: The glossaries package doesn't work with complex symbols as the example shows below. Is there a workaround available?               \documentclass{scrartcl}     \usepackage{amsmath}     \usepackage{glossaries}     \makeglossaries          \newglossaryentry{symb}     {         name={\ensuremath{\overset{\rightarrow}{A}}},         description={Description},     }          \begin{document}       works: $\overset{\rightarrow}{A}$\\       doesn't work: \gls{symb}            \printglossary[type=main]     \end{document}


title: Unable to modify modify TeX-command-list and setup pdf previewing in emacs and mactex

text: I am trying to setup a pdf preview command in emacs. Stumbling around the web I found the following which I thought I would try.               (eval-after-load "tex"       '(add-to-list 'TeX-command-list       '("pdfview" "open -a TeXShop %s.pdf" 'TeX-run-command nil t) t))      Unfortunately, the command does not show up in the command list when I type `C-c C-c`. _Is there something fundamentally different I need to do?_ Also, I am not running auctex, just using the vanilla latex-mode.


title: Getting the interlinear spacing correct within a paragraph when using minipages

text: Let me start by saying that this is very similar to a previously posted question, How to keep a constant baselineskip when using minipages (or \parboxes)?, for which _egreg_ gave a very nice solution. But either I'm not thinking through _egreg's_ solution correctly or this is a closely related but nevertheless different question. Also, I know I am doing things here that are generally frowned upon: namely, I set `\parskip`. But, I'm only doing this to create visually what it is that I don't want: `LaTeX` to think that I have a new paragraph here. `LaTeX` thinking there's a new paragraph does become an issue if, for example, I'm using `\everypar` to perform some task at the beginning of every paragraph. Onto my question: I occasionally find that I must align `minipages` to fill a line after which I do not want a new paragraph but a continuation of the _current paragraph_. But for some reason the interlinear spacing between the line filled with `minipages` and the following line is too small. I could fix this by inserting `\par~` at the end of the apparently offending `minipage`, or by using `\\\\[\baselineskip]` at the end of the line. But that opens up too excessive a break and visually creates the appearance of a new paragraph. My desire is not to create that visual break but rather insert the proper interlinear spacing. As mentioned already, _egreg's_ solution introduces a new paragraph which is not what I want. When I try to use _egreg's_ solution without introducing a new paragraph I get an error about being in horizontal mode. I could put in a strut at the end of the `minipage` to add more depth, but I really hate just _eye-balling_ it when it seems I should be able to get the interlinear spacing perfect. Also, sometimes I can fix this by setting `\hangindent`. But there are times when that's really not a feasible solution. Finally, I'd also prefer to avoid using the `wrapfig` package because there are other contexts in which I need a similar correction but wrapping is not what is needed. Here's my MWE:               \documentclass{article}     \usepackage{calc}     \usepackage{xcolor}     \usepackage{lipsum}     \usepackage{pst-node}     \usepackage[margin=1.25in]{geometry}     %%     \newcommand{\mytext}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.}     \setlength{\parskip}{5ex}     \pagestyle{empty}     \begin{document}     \newsavebox{\righthandmatter}     \begin{lrbox}{\righthandmatter}          \fbox{\begin{minipage}[t]{0.35\linewidth-2\fboxrule-2\fboxsep-2em}              \vspace{-\baselineskip}              \rule[-1cm]{0pt}{2cm} Some image or something          \end{minipage}}     \end{lrbox}               \noindent%     \textbf{Example 1:} Interlinear spacing is undesirably small---see arrow.\\[0.5\baselineskip]     \noindent%     \begin{minipage}[t]{0.65\linewidth}         \raisebox{0pt}[0pt][0pt]{\rput(-3ex,-8.25\baselineskip){\color{blue}\rnode{A}{$\longrightarrow$}}}         \lipsum[2]     \end{minipage}\hspace*{\fill}%     \usebox{\righthandmatter}     \mytext          \noindent%     \textbf{Example 2:} Following \texttt{egreg}'s suggestion: \LaTeX\ thinks there's a new paragraph---see arrow.\\[0.5\baselineskip]     \noindent%     \begin{minipage}[t]{0.65\linewidth}         \raisebox{0pt}[0pt][0pt]{\rput(-3ex,-8.25\baselineskip){\color{blue}\rnode{B}{$\longrightarrow$}}}         \raisebox{0pt}[0pt][0pt]{\rput(3.5in,-9.0\baselineskip){\color{blue}\rnode{C}{$\longleftarrow$ \fbox{\footnotesize{}Undesired new paragraph.}}}}         \lipsum[2]         %% solution suggested by egreg         \par\xdef\tpd{\the\prevdepth}     \end{minipage}\hspace*{\fill}%     \usebox{\righthandmatter}          %% enacting egreg's solution (But now I have a new paragraph).     \prevdepth\tpd%     \noindent\mytext          \vspace{1.5ex}     \noindent%     \textbf{Example 3:}  Interlinear spacing is as I want, but lines of the following text terminate too soon.\\[0.5\baselineskip]     \noindent%     \begin{minipage}[t]{0.65\linewidth}         \raisebox{0pt}[0pt][0pt]{\rput(-3ex,-8.25\baselineskip){\color{blue}\rnode{D}{$\longrightarrow$}}}%         \raisebox{0pt}[0pt][0pt]{\rput(4.8in,-8.75\baselineskip){\color{blue}\rnode{E}{$\longleftarrow$ \fbox{\footnotesize{}line terminates too soon.}}}}         \lipsum[2]         \mytext     \end{minipage}\hspace*{\fill}%     \usebox{\righthandmatter}          \end{document}      Here's an image: ![,](http://i.stack.imgur.com/eKuCn.png) How do I fix the interlinear spacing to get the desired effect? To better illustrate I provide another example. The right hand matter is indivisible such as a graphic. The left hand matter consists of a variety of paragraphs, equations, spaces for student responses, and possibly more graphics. Please keep in mind that this is a MWE so the content of the material which justifies formatting decisions is lost. But also, I usually face these sorts of formatting decisions in contexts where material resources are scarce and the luxury of using multiple pages cannot be abused too often. ![enter image description here](http://i.stack.imgur.com/8BrUB.png) Following **StephanLehmke** 's suggestion of `\parshape`: I could write               \documentclass{article}     \usepackage{calc}     \usepackage{xcolor}     \usepackage{lipsum}     \usepackage{pst-node}     \usepackage[margin=1.25in]{geometry}     %%     \setlength{\parskip}{5ex}     \newlength{\aelinewidth}     \pagestyle{empty}     \begin{document}     \setlength{\aelinewidth}{\linewidth}     \newsavebox{\righthandmatter}     \begin{lrbox}{\righthandmatter}          \fbox{\begin{minipage}[t]{0.35\linewidth-2\fboxrule-2\fboxsep-2em}              \vspace{-\baselineskip}              \rule[-2.5cm]{0pt}{3.5cm}\parbox{\linewidth}{\raggedright{}Some image or something that is unbreakable}          \end{minipage}}     \end{lrbox}          \noindent%     \begin{minipage}[t]{0.65\linewidth}         \begin{minipage}[t]{\linewidth}         \textbf{Question 1:}            Nam dui ligula, fringilla a, euismod sodales, sol- licitudin vel,         wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at,         lobortis vitae, ultricies et, tellus. Donec ali- quet, tortor sed\par         \parshape 6  0pt \linewidth 0pt \linewidth 0pt \linewidth 0pt \linewidth 0pt \linewidth 0pt 6in         \textbf{Question 2:}            Nam dui ligula, fringilla a, euismod sodales, sol- licitudin vel,         wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at,         lobortis vitae, ultricies et, tellus. Donec ali- quet, tortor sed         accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a         mi. Morbi ac orci et nisl hendrerit mol- lis. Suspendisse ut         massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque         penatibus et magnis dis parturient montes, nascetur ridiculus         mus. Aliquam tincidunt urna. Nulla ullamcor- per vestibulum         turpis. Pellentesque cursus luctus mauris.  \textbf{Continuation of         question 2's paragraph} Lorem ipsum dolor sit amet, consectetuer         adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing         vitae, felis.  Nam dui ligula, fringilla a, euismod sodales, sol-         licitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero,         pretium at, lobortis vitae, ultricies et, tellus. Donec ali- quet,         tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare         odio metus a mi. Morbi ac orci et              \end{minipage}     \end{minipage}\hspace*{\fill}%     \usebox{\righthandmatter}          \end{document}      which gives me a reasonably good result like I wanted: ![enter image description here](http://i.stack.imgur.com/1zyYz.png) So now my question becomes, is there an approach other than using `\parshape` which is more in the spirit and style of **egreg** 's solution on the above mentioned link? Essentially, I feel that I'm not understanding something about interlinear glue. I guess I'm asking for a clarification of that glue which would be applicable in the situations I've illustrated above. This is probably the wrong place to put this comment: But, interestingly enough, I had to embed my `\parshape` paragraph inside another `minipage` or else the width of the containing `minipage` is ignored. This related to an earlier question I posted minipage is wider than I wanted. The solution I got before was that it had to do something with how `align` worked whether the equation was tagged or not. Remove the inner wrapping `minipage` and there's another example whether the `minipage` width is ignored.


title: Turning font-changing macros into font-changing "switches"

text: I want to turn a font-changing macro into a "switch" (I found the term in this answer), making macros like `\macro{Text to be changed}` work within the brakets, like `{\switch text to be changed}`, similarly to `\textbf`'s and `\bfseries`'s behavior. I'm working with a thesis class which provides formatting commands like `\titleformat`, `\authornameformat`, etc., which can be changed. But in the whole class, those formatting commands are used like switches, so you have a `\titlepage` command that prints `{\titleformat \titledata}`, etc. I want to change some of these formatting commands into real small caps, which I defined as `\DeclareRobustCommand{\smallcaps}[1]{\textls[10]{\scshape\MakeLowercase{#1}}}`, but I don't know how I could make a switch to lowercase letters (i tried it with `textcase` package's `\MakeTextLowercase` too).               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[osf]{libertine}     \usepackage{letterspace}          \DeclareRobustCommand{\smallcaps}[1]{\textls[10]{\scshape\MakeLowercase{#1}}}          \begin{document}          \smallcaps{These are real smallcaps}, {\smallcaps these are not} and this is normal.          \end{document}


title: Annoying problem with fancyhdr and auto-generated chapters

text: I have been facing an annoying little problem. I'm using `fancyhdr` to customize the headings on my thesis but according to the package documentation it is unable to remove the "uppercasedness" of the headings on chapters like Bibliography, Index and so on, because `\MakeUppercase` is explicitly given independently by those packages. It suggests redefining `\thebibliography` and searching `natbib.sty` I found               \providecommand{\MakeUppercase}{\uppercase}      followed by its usage inside the `\bibsection` redefinition. I have tried playing around with that for a while, trying to redefine `\bibsection` in my preamble, but that only ended up messing the Bibliography's title. Moreover, this is not just about the Bibliography: other non-numbered chapters (all of them, actually) suffer from this. For the problem at hand I came up with a _kind of_ solution, which is to redefine \MakeUppercase:               \renewcommand{\MakeUppercase}{}      That solves my _immediate_ problem. But I'm not comfortable with that, because I might need to use uppercase letters in this or in any other document. Since I always use lowercase in the headings, this might be an issue. What would a better solution do? Would I need to actually redefine commands related to each aspect, Bibliography, Index, Table of Contents, and so on?


title: Circular sequence diagram (tikz?)

text: Apologies in advance for the slightly-crappy camera phone picture: ![circular sequence](http://i.stack.imgur.com/w6maa.jpg) I'd like to include some figures like this in something I'm working on. I've just started learning tikz, which seems like it could be used to do something like this, but I'm not quite dextrous enough just yet. The included picture has 16 cells, but I have another figure with 8 cells and a less important one with 27 cells, so if this can be done generally to make doing those easy as well, that'd be great.


title: MindMapping with LaTeX

text: Is there any mind mapping tool which will allow for typing in LaTeX? I particularly like FreeMind but it has no LaTeX support.


title: is there a "size-independent" method for overlaying two symbols to form a composite?

text: in this question a composite symbol "diamond plus" is requested for use with plain TeX. a good-looking version was provided, but it works in only one size. if the same symbol is needed for a title or a footnote (i.e., in a larger or smaller size), the image produced by the provided code will be deformed. this would be true for LaTeX as well as plain TeX, and is a different problem than the one addressed by `\mathchoice`. the overlay technique is sensitive to a couple of things: the need to use explicit dimensions, and (often) the need to pack at least one of the components in a box, which "freezes" the size at the current value. (`\rlap`, `\llap` and `\\[math]clap`, while very useful, are underlain by boxes, so are subject to the "single size" limitation.) there are some TeXniques than can be brought to bear on this situation:   * to adjust for relative current size, the `amsmath` command `\text` is available.   * dimensions can be expressed as `ex`, `em` or `mu` to accommodate to the current size, but they must be employed carefully at appropriate places in a definition to get the desired effect. it is also the case that (for computer modern fonts) the different design sizes may not have the same aspect ratio; this is particularly true for bold vs. normal weight.   * another possibility is to take advantage of the fact that `\mathop` will vertically center a single glyph on the math axis. has anyone come up with a robust, flexible mechanism for overlaying glyphs to form a composite symbol that will reliably adjust to the size of type in the current environment? for simplicity in a first cut, it's acceptable to stick to computer modern/latin modern fonts. the questions overlay symbol with another, how to add a custom symbol to LaTeX, and several others deal with the construction of particular symbols, but i'm looking for a general technique.


title: Is it possible to automatically set numbers=none for single-line lstlisting environments?

text: I apologise if the answer to my question can be found in the listings documentation and I missed it. Essentially I would like line numbers to be set only if the number of lines is greater than one.


title: How to draw arrows between parts of an equation to show the Math Distributive Property (Multiplication)?

text: there is a part of my paper where I use the distributive property and it's not that clear for the reader to see (I'm using in proposional logic for a proof). The logic equation (part of) is:               (l_{1}) \vee \big( (p \vee q) \wedge (\neg p \vee q) \wedge (p \vee \neg q) \wedge (\neg p \vee \neg q)\big) \\     (l_{1} \vee p \vee q) \wedge (l_{1} \vee \neg p \vee q) \wedge (l_{1} \vee p \vee \neg q) \wedge (l_{1} \vee \neg p \vee \neg q)      So I was wondering if there is a way to represent it, like as a 'shower' (see pic 1). Maybe there is some hidden magic mathmode command or pkg for this :) or at last I could do tikz :~ ![Distributive Property](http://i.stack.imgur.com/LMniS.jpg)


title: Arrows in LaTeX

text: > **Possible Duplicate:**   >  How to draw arrows between parts of an equation to show the Math > Distributive Property (Multiplication)? I need to have arrows pointing from one part of an equation to another part -- actually just like in the redox reaction shown in the background of this page (right above where it says "Questions | Tags | Users | Badges" at the top). Could somebody please show me how?


title: How can I change figure caption label?

text: I am using `revtex4-1` for a Physical Review Letter. Typically when a figure is made, the caption starts out `FIG. 1. <text>`. I am creating a supplementary file and I would like it to say `FIG. S1. <text>`. How can I change that?


title: Align subfigures in opposite pages to the top

text: I have two collections of subfigures (produced using the `subfig` package) that Latex decided to place in opposite pages. I would like to align them to the top of the page but for some reason there's always an extra white space atop the figure in the right page (notice the difference with the red line in the screenshot). I've already checked the images and they are correctly cropped. ![misaligned figures](http://i.stack.imgur.com/IIfxC.png) I tried to save and adjust the position of the figures using `zref-savepos` as explained here but it doesn't seem to do anything. If possible, I would like to align them to the red line. I would also welcome a small explanation about why Latex feels the need to produce that extra white space. **EDIT:** As requested I'm adding a MWE:               \documentclass[         b5paper,         10pt,         chapterprefix=on,         appendixprefix=on,         numbers=noenddot,     ]{scrbook}          \usepackage{scrpage2}     \usepackage{geometry}     \usepackage{lipsum}     \usepackage{subfig}     \usepackage[demo]{graphicx}          \begin{document}          \chapter{A Chapter}          \lipsum[1-2]          \begin{figure}%[t]         \centering              %\zsaveposy{figa}%         %\ifnum\zposy{figb}>\zposy{figa} %         %  \vspace{-\dimexpr\zposy{figb}sp-\zposy{figa}sp}%         %\fi              \subfloat[fig1]{             \includegraphics[width=4.5in, height=1.13in]{fig1}         }\\         \subfloat[fig2]{             \includegraphics[width=2.2in, height=0.82in]{fig2}         }         \subfloat[fig3]{             \includegraphics[width=2.2in, height=0.82in]{fig3}         }         \caption{First caption.}              %\ifnum\zposy{figb}>\zposy{figa} %         %  \vspace{\dimexpr\zposy{figb}sp-\zposy{figa}sp}%         %\fi         %         \label{fig2a}     \end{figure}          \lipsum[1-2]          \begin{figure}[t] % This [t] is commented out in the real code         \centering              %\zsaveposy{figb}%         %\ifnum\zposy{figa}>\zposy{figb} %         %  \vspace{-\dimexpr\zposy{figa}sp-\zposy{figb}sp}%         %\fi              \subfloat[fig1]{             \includegraphics[width=2.2in, height=0.82in]{fig1}         }         \subfloat[fig2]{             \includegraphics[width=2.2in, height=0.82in]{fig2}         }\\         \subfloat[fig3]{             \includegraphics[width=2.2in, height=0.82in]{fig3}         }         \subfloat[fig4]{             \includegraphics[width=2.2in, height=0.82in]{fig4}         }\\         \subfloat[fig5]{             \includegraphics[width=2.2in, height=0.82in]{fig5}         }         \caption{Second caption.}              %\ifnum\zposy{figa}>\zposy{figb} %         %  \vspace{\dimexpr\zposy{figa}sp-\zposy{figb}sp}%         %\fi         %         \label{fig2b}     \end{figure}          \lipsum[1-10]          \end{document}      **UPDATE:** I answered my own question with a solution to manually fine-tune the alignment in case someone finds it useful later on. I will probably try setting up a bounty later on to see if a better solution comes up.


title: Latex in Turkish

text: I wish to create an article in Turkish in Latex. I want chapters, table of contents etc to appear in Turkish. For example when I write this,               \documentclass[a4paper,12pt]{article}          \begin{document}          \chapter{Giriş}          \end{document}      I want the output as                Bölüm 1 (that is Turkish for Chapter 1)            Giriş (Turkish for Introduction)      Is that possible or just a dream?


title: I am not getting justified while using {Warsaw,Antibes} theme. Can anyone please help me in this regard

text: \documentclass{beamer}     \usepackage{ragged2e}   %new code     \usetheme{Warsaw,Antibes}          \addtobeamertemplate{block begin}{}{\justifying}  %new code          \begin{document}         \begin{frame}{Test}             \begin{block}{Test}                 The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog.             \end{block}         \end{frame}     \end{document}


title: Headerbox alignment

text: How is it possible to customize alignment (in my case align to center) of title in `headerbox` using `baposter`? Trying this:               \begin{poster}{headerfont=\Large\sf\centering}      or               \headerbox{\rule{0pt}{0pt}\hspace{\stretch{1}} Motivation \hspace{\stretch1}\rule{0pt}{0pt}}     {name=motivation}     {foo bar}      didn't work at all. When using `\hspace{1cm}` the space is correctly wide. Edit:               \documentclass[a0paper,portrait,fontscale=.298]{baposter}          \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage[%font=small,     labelfont=sf]{caption} % Required for specifying captions to tables and figures     \usepackage{booktabs} % Horizontal rules in tables     \usepackage{relsize} % Used for making text smaller in some places     \usepackage{amsmath,amssymb}     \usepackage{multicol}          \usepackage[T1]{fontenc}     \usepackage{textcomp}          \definecolor{bordercol}{RGB}{40,40,40} % Border color of content boxes     \definecolor{headercol1}{RGB}{224,177,0} % Background color for the header in the     content boxes (left side)     \definecolor{headercol2}{RGB}{80,80,80} % Background color for the header in the     content boxes (right side)     \definecolor{headerfontcol}{RGB}{0,0,0} % Text color for the header text in the content boxes     \definecolor{boxcolor}{RGB}{255,255,255} % Background color for the content in the content boxes          \begin{document}          \begin{poster}{     borderColor=bordercol, % Border color of content boxes     headerColorOne=headercol1, % Background color for the header in the content boxes     (left side)     headerColorTwo=headercol1, % Background color for the header in the content boxes     (right side)     headerFontColor=headerfontcol, % Text color for the header text in the content boxes     boxColorOne=boxcolor, % Background color for the content in the content boxes     headershape=rectangle, % Specify the rounded corner in the content box headers     headerfont=\Large\sf, % Font modifiers for the text in the content box headers     textborder=%rectangle,%     faded,     linewidth=1pt,     background=none,     colspacing=5pt,     columns=6,     headerborder=open, % Change to closed for a line under the content box headers     boxshade=plain,     headerheight=.095\textheight     }          %----------------------------------------------------------------------------------------     %   TITLE AND AUTHOR NAME     %------------------------------------------------------------------------------------    ----     {} % University/lab logo     {Title} % Poster title     {Tomas Marny\\ % Author names     {tom@smarny}} % Author email addresses     {} % University/lab logo          \headerbox{\rule{0pt}{0pt}\hspace{\stretch{4}} Motivation} \hspace{\stretch{4}}\rule{0pt}{0pt}     {name=motivation,column=0,row=0,span=6}     {foo bar}     \end{poster}     \end{document}


title: Indentation in tcolorbox package

text: I'd like to have the same indentation within a tcolorbox as I have in the rest of the document. How can I get it? Thanks. MWE:               \documentclass[a4paper]{book}          \usepackage{lipsum}     \usepackage[most]{tcolorbox}          \begin{document}          \chapter{Example with \texttt{tcolorbox}}     \lipsum[1-8]          \begin{tcolorbox}[breakable,enhanced]     \lipsum[9-14]     \end{tcolorbox}          \end{document}      The first block of text has the typical indentation, but that in the box doesn't.


title: writing "_" like a character

text: I would like to write               \texttt{set_x}      where "_" is an character and not a "math instruction". But Latex recognise it like a math instruction and ask for the missing $$...How can I do?


title: Trouble creating custom algorithm environment with separate counter

text: I am trying to create a custom algorithm environment for CUDA kernel code that runs on the GPU, but have little experience with custom LaTeX. It should have a separate counter, be referenced as **Kernel X** by the cleveref package, and possibly show up in the list of algorithms as a kernel somehow to distinguish it from regular algorithms. The following is my M(-kinda-)WE. It gets counters working, but not references. Also I am unable to properly include the placement specifiers in the kernel environment.               \documentclass[11pt]{article}     \usepackage{algorithm}     \usepackage{algorithmicx}     \usepackage{hyperref}     \usepackage[nameinlink, noabbrev]{cleveref}     \usepackage{float}          % Custom reference command     \newcommand{\sref}[1]{\textbf{\cref{#1}}}     \newcommand{\Sref}[1]{\textbf{\Cref{#1}}}          \newcounter{kernel}     \newcounter{temp}          \newenvironment{kernel}[1][ps]{%         \newcommand{\algorithmname}{Kernel}%         \setcounter{temp}{\value{algorithm}}%         \setcounter{algorithm}{\value{kernel}}%         \refstepcounter{kernel}%         \begin{algorithm}[#1]%         \floatname{algorithm}{Kernel}%     } {\end{algorithm}\setcounter{algorithm}{\value{temp}}}          \floatname{kernel}{Kernel}     \crefname{kernel}{kernel}{kernels}     \Crefname{kernel}{Kernel}{Kernels}          \begin{document}     \begin{algorithm}[htb!]         \caption{Some really cool algorithm}         \label{alg:algorithm1}              \begin{algorithmic}             \State $x \gets 1$         \end{algorithmic}     \end{algorithm}          \begin{kernel}[htb!]         \caption{Some other really cool algorithm}         \label{alg:algorithm2}              \begin{algorithmic}             \State $y \gets 2$         \end{algorithmic}     \end{kernel}          \begin{algorithm}[htb!]         \caption{Another one...}         \label{alg:algorithm3}              \begin{algorithmic}             \State $w \gets 3$         \end{algorithmic}     \end{algorithm}          \begin{kernel}[htb!]         \caption{The last one, I promise}         \label{alg:algorithm4}              \begin{algorithmic}             \State $w \gets 4$         \end{algorithmic}     \end{kernel}          As implied in~\ref{alg:algorithm1} aka~\autoref{alg:algorithm1} aka~\nameref{alg:algorithm1} aka~\cref{alg:algorithm1} aka~\sref{alg:algorithm1} it is really cool. The same goes for     ~\ref{alg:algorithm2} aka~\autoref{alg:algorithm2} aka~\nameref{alg:algorithm2} aka~\cref{alg:algorithm2} aka~\sref{alg:algorithm2}.          \end{document}      Most of the examples I found here where either concerned with the algorithm2e package or didn't do quite what I wanted. **EDIT:** I succeeded in passing the placement specifiers to the `algorithm` environment.


title: Unable to generate PDF/A with `marvosym` package

text: I am unable to generate a PDF file that is compliant to PDF/A (version 1b) when using fonts of the `marvosym` package. A minimal working example is the following:               \documentclass{scrbook}     \usepackage{marvosym}     \begin{document}     \Libra     \end{document}      I compile with `pdflatex` of the MiKTeX package. When checking the resulting PDF for PDF/A compliance, there are error messages that glyphs are missing in the embedded font and that width information is inconsistent for printed glyphs. Is there a way to use the above Libra symbol and generate a PDF/A compliant output?


title: Which LaTeX fonts have old style numbers?

text: I want to set a text and I know that I want old style numbers. Does anyone know of some source or maybe can themselves list fonts with old style numbers?


title: Unwanted space after figure environment

text: When the figure environment directly follows a `\\[ ... \\]` environment an unwanted space occurs in the output. It obviously seems to be an endlinechar which is changed into a space.               \documentclass{article}     \begin{document}     \[ a  = b. \]     \begin{figure}       figure     \end{figure}     Text\\     Text          \[ a  = b. \]     \begin{figure}       figure     \end{figure}%     Text\\     Text          \end{document}      I know I can get rid of this adding a `%` after `\end{figure}` or generally by adding `\ignorespaces` to the figure environment with etoolbox's `\AfterEndEnvironment`. My question is: is this a bug or expected behaviour? And if it is a bug who do I send a report? _EDIT:_ It seems my example was not really a minimal one. As it turns out the display environment is not necessary to get the space:               \documentclass{article}     \begin{document}     a%     \begin{figure}       \caption{A}     \end{figure}     b          and          c\\     d%     \begin{figure}       \caption{B}     \end{figure}     e          vs.          f%     \begin{figure}       \caption{C}     \end{figure}%     g          \end{document}      In case I didn't make it clear enough: I am not interested in a way to avoid the space -- I know already how to do that. I admit that such information might be useful for other readers, though. I rather want to know if this behaviour is to be expected of the `figure` environment or a bug?


title: draw direction cosines using tikz

text: How I can easily draw the direction cosines using TikZ?![enter image description here](http://i.stack.imgur.com/HxYyO.png)


title: Latexmk: makeglossaries, Biber and pdfLaTeX / Where to put latexmkrc?

text: I've got myself seriously confused with latexmk. I have been using latexmk on TeX Live 2011 and I have loved it for making my document with a ToC and references with Biber. I am trying to make it work with the `glossaries` package (makeglossaries) and I've hit a brick wall. I've already looked at How to make Latexmk use makeglossaries? and have seen the suggestions of code to add but I can't find the latexmkrc file to save my life. I've searched in all the places that the latexmk manual suggests and I'm positive I'm viewing hidden files. It would make my live much easier if the config file was in the directory with the document because I'm using a couple of different machines to do my writing. In the end I would like latexmk to run pdfLaTeX, Biber and makeglossaries enough times to make my ToC, List of Tables, List of Figures, references and List of Abbreviations. I'm running TeX Live 2011, which is fully updated. I'm using latexmk through TeXworks (it came ready configured).


title: Function to make url appear ONLY in electronic entries

text: I am using TexStudio and IEEEtran as bibliography style but it shows all the url in the reference which is not helpful. I would like to know is there anyway to write a function that identify the entries of bibliography? I would only want url to be displayed for electronic or misc entries. Thank you


title: Using \iupac{\D} or \D in a \paragraph{} environment

text: How can I use the `\D` or `\iupac{\D}` command from `chemmacros` package in a `\paragraph` environment? The result I get is a lower case d instead of the D- for the Fischer stereo descriptor.               \documentclass[a4paper]{scrreprt}       \usepackage{chemmacros}            \begin{document}       \paragraph{\D-Proline}       \end{document}


title: Cyrillic font for XeLaTeX in OS X

text: I'm switching to XeLaTeX and have a problem choosing a Cyrillic (Russian) font for the document. If I try just               \documentclass[a4paper,12pt]{report}               \usepackage{polyglossia}     \setdefaultlanguage{russian}          \begin{document}     Hi! Привет!     \end{document}      an error is thrown:               Package polyglossia Error: The current roman font does not contain the Cyrillic script!      As far as I understand I must explicitly specify a font. Unfortunately I know close to nothing about fonts and I have no guidelines imposed to follow. What is a recommended Cyrillic font in OS X? Some kind of rule of thumb to set and forget about.


title: Change Color, Pitch, Line Style of Showframe (Geometry Package)

text: How can one change the colour, pitch, line style, etc of the rules generated by the `geometry` package's `showframe` option?


title: Alignment in cases

text: I have this text in LaTeX:               $$     sgn(x)=     \begin{cases}        -1 & \mbox{za podmínky } x>0\\         0 & \mbox{za podmínky } x=0\\         1 & \mbox{za podmínky } x>0     \end{cases}     $$      ![sgn](http://i.stack.imgur.com/TlGou.jpg) But I would like to move the "0" and "1" more to the right. I need to move these numbers just below "1", not to have it below "-".


title: Alignment inside the \align enviroment-horizontally and vertically

text: Is it possible to make both expressions for omega's aligned with one another and do the same for the coefficients a,b,r and d,c,t? I tried to align them manually by using `center` but it does not work.                \usepackage[pdftex]{graphicx}      \usepackage[T1]{fontenc}      \usepackage{fouriernc}      \usepackage{amsmath}      \usepackage{amsthm}      \usepackage{amsfonts}      \usepackage{amssymb}      \begin{document}      \begin{align*}      \omega_{1}^2&=1-2\sqrt[3]{19}+\sqrt[3]{19^2}\\      \omega_{1}^{2}&=b\omega_{1}+a\omega_{2}+r      \end{align*}        \begin{center}      $a=3,\hspace{1cm}b=-3,\hspace{1cm}r=-3$      \end{center}      similarly      \begin{align*}      \omega_{2}^2&=\frac{1}{3}(13+7\sqrt[3]{19}+\sqrt[3]{19})\\       \omega_{2}^{2}&=d\omega_{1}+c\omega_{2}+t      \end{align*}      \begin{center}      $d=2,\hspace{1cm}c=1,\hspace{1cm}t=6$      \end{center}      \end{document}      I get something like this ![enter image description here](http://i.stack.imgur.com/sf8sF.jpg) Is it possible to use align within `align` environment? Thank you


title: Expand placeins functonality to subsections

text: I'm using the `placeins` package to ensure that floats stay within their respective sections (using `\usepackage[section]{placeins}`). I'd like to expand this functionality to include `subsections`, without me having to manually add a `\FloatBarrier` each time. I found this answer while looking online, however, I don't want to add the extra package to my distribution, as it will not get updated and might break in the future. I fumbled around in the file, and found that this part of the `.sty` file does what I want:               \AtBeginDocument{%          \expandafter\renewcommand\expandafter\subsection\expandafter            {\expandafter\@fb@subsecFB\subsection}%          \newcommand\@fb@subsecFB{\FloatBarrier          \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}          \g@addto@macro\@afterheading{\@fb@afterHHook}          \gdef\@fb@afterHHook{}       }      i.e. it appends `\FloatBarrier` to the `subsection`. However, placing this piece of code right after `\usepackage[section]{placeins}` doesn't seem to work. I'm guessing there is more to LaTeX command syntax than what I've written and that I'm not getting it right, but my knowledge of LaTeX does not extend far enough to debug this on my own. Anyone willing to help? Here's a MWE:               \documentclass{report}          \usepackage[section]{placeins}     \AtBeginDocument{%          \expandafter\renewcommand\expandafter\subsection\expandafter            {\expandafter\@fb@subsecFB\subsection}%          \newcommand\@fb@subsecFB{\FloatBarrier          \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}          \g@addto@macro\@afterheading{\@fb@afterHHook}          \gdef\@fb@afterHHook{}       }     \begin{document}          \section{Section 1}          \begin{figure}     \centering     \Large A     \caption{First figure}     \end{figure}          \subsection{Subsection 1.1}          \begin{figure}     \centering     \Large B     \caption{Subsection 1.1 figure}     \end{figure}          \subsection{Subsection 1.1}          \begin{figure}     \centering     \Large C     \caption{Subsection 1.2 figure}     \end{figure}          \section{Section 2}          \end{document}


title: Distance between chapter title and the baseline of the following text

text: Consider the code below. The distance between the chapter title and the baseline of the following text is font dependent. I assume that there is a glue between the chapter title and the top of the first row. When I insert a `\strut` at the beginning of the paragraph, the distance seems to be fixed (which makes sense, as the strut is always the same, regardless of the current font. **How can I fix the problem, that the distance between the chapter title and the base line of the first text row is font dependent?** Can I insert a \strut at every par? Can I say " _x_ pt distance to then next baseline"? ![enter image description here](http://i.stack.imgur.com/3dwNe.png) ![enter image description here](http://i.stack.imgur.com/jduxp.png)               \documentclass[11pt]{book}     \usepackage{lipsum,xcolor}     \usepackage{mathpazo}     % \usepackage{lua-visual-debug}     \usepackage[showframe]{geometry}          \usepackage{titlesec}     \titleformat{\chapter}[hang]{\fontsize{20bp}{20bp}\selectfont}{\thechapter}{1ex minus .1ex}{}          % without strut at the beginning of first paragraph     % \titlespacing*{\chapter}{0cm}{\dimexpr -\topskip }{6.5bp}[0pt] % mathpazo     % \titlespacing*{\chapter}{0cm}{\dimexpr -\topskip }{6.9bp}[0pt] % mathptmx          % with strut at the begining of the first paragraph     \titlespacing*{\chapter}{0cm}{\dimexpr -\topskip }{6bp}[0pt]   % mathptmx + mathpazo          \renewcommand\normalsize{\fontsize{9bp}{10bp}\selectfont}               \parskip0pt               \usepackage{atbegshi,picture}     \makeatletter     \AtBeginShipout{%       \AtBeginShipoutUpperLeft{%         \put(\dimexpr           \ifodd\value{page}\oddsidemargin\else\evensidemargin\fi + 1in\relax,           -\dimexpr\topmargin + 1in + \headheight + \headsep\relax){%           \begin{picture}(0,0)%             \setlength{\unitlength}{10bp}%             \setlength{\dimen0 }{0pt}%             \@whiledim\dimen0<\dimexpr\textheight+1sp\relax\do{%               \put(0,-\dimen0){\color{green}\line(1,0){\textwidth}}%               \addtolength{\dimen0 }{\unitlength}%             }%           \end{picture}%         }%       }%     }     \makeatother          \begin{document}     \chapter{Chapter title}     %\strut     \lipsum[1-3]          \end{document}


title: Is LaTeX's placement of figures correct?

text: I often hear that the best thing when dealing with floats in latex is to let latex do its thing and place them where it wants. I have mostly not listened to this but instead used the float-package and the H option to force the figures to where I want. But then a while ago I decided to follow the advice and just leave it all to latex. This was for a report for class and I got a comment from the teaching assistant that I should avoid letting figures divide sections. My question is therefore: Is latex float placement correct as in "if latex placed it there it is a proper place for it" or is it more like "if latex placed it there it makes the page look good from a distance". To me these are two totally different things. It may look good, text flowing evenly around figures and tables but not be readable. And it may look worse, chunks of white space before/after figures but be really readable. I would really appreciate some input on this.


title: colored toc and shorttoc?

text: I want to have colored part and chapter names in my shorttoc _and_ my toc. So I worked out how to get the shorttoc colored, but I do not know how to get the toc also colored the same way? If I add the commands twice (between `\makelatter` and `\makeatother`) it does not work. So how can I get both colored the same way? Here's my code:               \documentclass{book}          \usepackage[pagestyles]{titlesec}     \titlespacing*{\chapter}{0pt}{-30pt}{20pt}     \titleformat{\chapter}[display]{\color{headercolor}\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}          \titleformat{\section}     {\color{headercolor}\normalfont\Large\bfseries}{\thesection}{1em}{}          \titleformat{\subsection}     {\color{headercolor}\normalfont\Large\bfseries}{\thesubsection}{1em}{}          \titleformat{\subsubsection}     {\color{headercolor}\normalfont\large\bfseries}{\thesubsubsection}{1em}{}          \titleformat{\paragraph}     {\color{headercolor}\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}          \usepackage[ngerman]{babel}     \usepackage[hidelinks]{hyperref}          \usepackage{xcolor,bookmark}     \usepackage{shorttoc}     \usepackage{tocstyle}     \usetocstyle{allwithdot}           \definecolor{headercolor}{rgb}{0.6941,0.6745,0.4863}          \begin{document}     \frontmatter     \makeatletter     \let\stdl@part\l@part     \renewcommand*{\l@part}[2]{%       \stdl@part{\textcolor{headercolor}{#1}}{\textcolor{headercolor}{#2}}}     \let\stdl@chapter\l@chapter     \renewcommand*{\l@chapter}[2]{%       \stdl@chapter{\textcolor{headercolor}{#1}}{\textcolor{headercolor}{#2}}}          \makeatother          \setcounter{tocdepth}{4}     \setcounter{secnumdepth}{4}     \shorttableofcontents{Inhalts\"ubersicht}{1}     \bookmark[page=15,rellevel=1,keeplevel,view={XYZ},color=red]{Inhalts\"ubersicht}     \bookmark[page=17,rellevel=1,keeplevel,view={XYZ},color=red]{Inhaltsverzeichnis}     \tableofcontents     \clearpage     \pagenumbering{arabic}            \mainmatter          \part{test}     \chapter{test}     \section{test1}     \section{test2}     and so on....     and so on.....     \end{document}      Now the shorttoc is colored bot not the toc, but I want both colored.


title: Draw a radial basis function diagram in LyX

text: I am trying to draw the following simple radial basis function diagram in my LyX document: ![example](http://i.stack.imgur.com/c7lsx.jpg) So, I need help to write the LaTeX code, but I would like the output image to be as follows: ![wanted](http://i.stack.imgur.com/bzQb3.png) I tried this code in ERT box of Lyx which gave me Figure number 2 .. but I am clueless that how include the special symbol inside the circle node of hidden layer.               \begin{figure}[htp]     \centering     \begin{tikzpicture}[     plain/.style={       draw=none,       fill=none,       },     net/.style={       matrix of nodes,       nodes={         draw,         circle,         inner sep=8.5pt         },       nodes in empty cells,       column sep=0.6cm,       row sep=-11pt       },     >=latex     ]     \matrix[net] (mat)     {     |[plain]| \parbox{1cm}{\centering Input\\layer} & |[plain]| \parbox{1cm}{\centering Hidden\\layer} & |[plain]| \parbox{1cm}{\centering Output\\layer} \\     & |[plain]| \\     |[plain]| & \\     & |[plain]| \\     |[plain]| & |[plain]| \\     & & \\     |[plain]| & |[plain]| \\     & |[plain]| \\     |[plain]| & \\     & |[plain]| \\     };     \foreach \ai [count=\mi ]in {2,4,...,10}          \draw[<-] (mat-\ai-1) -- node[above] {I\mi} +(-1cm,0);     \foreach \ai in {2,4,...,10}     {\foreach \aii in {3,6,9}       \draw[->] (mat-\ai-1) -- (mat-\aii-2);     }     \foreach \ai in {3,6,9}       \draw[->] (mat-\ai-2) -- (mat-6-3);     \draw[->] (mat-6-3) -- node[above] {O1} +(1cm,0);     \end{tikzpicture}               \end{figure}


title: What is the easiest way to accomplish textual tick labels in tikz?

text: Consider the following simple PV-diagram: ![http://i.imgur.com/U9nxbJU.png?1](http://i.stack.imgur.com/vSsdG.png) The code below created it and the output is fine. I used kind of a workaround with an array to get the right tick labels on both of the axes. That works fine for low values, but if I want to set for instance `V_f = 200`, getting the tick label right is going to be a bit of a problem. What's a proper fix to get the tick labels? Can I tell `tikz` to use the "next" element of my array every time it actually printed the tick? I could think of a solution which increments a counter only when the printing happens, but surely there's a `tikz` solution for this ? * * *               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=1.10}     \usetikzlibrary{arrows,arrows.meta, decorations.markings,backgrounds, intersections}     \makeatletter     \tikzset{         nomorepostaction/.code=\makeatletter\let\tikz@postactions\pgfutil@empty,          my axis/.style={             postaction={                 decoration={                     markings,                     mark=at position 1 with {                         \arrow[ultra thick]{latex}                     }                 },                 decorate,                 nomorepostaction             },             thin,             -, % switch off other arrow tips             every path/.append style=my axis % this is necessary so it works both with "axis lines=left" and "axis lines=middle"         }     }     \makeatother     \begin{document}     \begin{figure}     \def\xt{{0,"$V_i=1$",0,"$V_f=3$"}}\relax     \def\yt{{0,"$P_i=1$",0,"$P_f=3$"}}\relax     \begin{tikzpicture}     \begin{axis}[         axis lines=left,         width=.95\linewidth,         axis line style={my axis},         xmin = 0, xmax = 4,         ymin = 0, ymax = 4,         xticklabel={\pgfmathparse{\xt[\tick]}\pgfmathresult},         xtick={1,3},         yticklabel={\pgfmathparse{\yt[\tick]}\pgfmathresult},         ytick={1,3},         xlabel={Volume},         ylabel={Pressure}         ]       \path[name path=axisa] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},1) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},1);       \path[name path=axisb] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},3) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},3);     \addplot[name path=graph, black,very thick,  -latex ] coordinates             {(1,1) (3,3)}              ;        \path[name intersections={of=axisa and graph, by={interpa}}];           \path[name intersections={of=axisb and graph, by={interpb}}];        \draw[ultra thin, dashed] (axis cs:0,1) -- (interpa);        \draw[ultra thin, dashed] (axis cs:1,0) -- (interpa);        \draw[ultra thin, dashed] (axis cs:0,3) -- (interpb);        \draw[ultra thin, dashed] (axis cs:3,0) -- (interpb);     \end{axis}     \end{tikzpicture}     \caption{}     \end{figure}     \end{document}


title: Is there a standard way to refer to a range of equations?

text: I have occasionally wanted to refer to a range of equations in my document. So far, I've been using `Equations~\eqref{firstEquation}~--~\eqref{lastEquation}`, which produces something like "Equations (5) - (12)". I recognize that this could make it harder to maintain the document if equations get shifted around, but I still prefer it to something like "Equations (5), (6), (7), (8), (9), (10), (11), and (12)". Is there a standard or accepted way to refer to a range of equations like this? Or should I just keep doing whatever looks best to me?


title: Redefinition problem with \maketitle from KOMA class (with optional argument)

text: I try to redefine the `\maketitle` command as shown below. If I use an optional argument in the redefinition I get the `TeX capacity exceeded` error. Any suggestion why? MNWE:               \documentclass{scrreprt}          \title{My Title}     \author{My Name}          \let\oldmaketitle\maketitle          \renewcommand{\maketitle}[1][]{%       \oldmaketitle       \rule{\textwidth}{1pt}     }          \begin{document}          \maketitle          \end{document}


title: Line spacing with scandinavian letters

text: Example tex               \documentclass{article}     \begin{document}     Ylim\"{a}\"{a}r\"{a}isi\"{a} suodatuksia ja ikkunointeja ei tarvita, jos menetelm\"{a} pystyy itsess\"{a}\"{a}n erottelemaan ilmi\"{o}n ep\"{a}jatkuvuuskohdat, kuten syd\"{a}men kammion yht\"{a}kkisen liian aikaisen supistuksen tai syd\"{a}nl\"{a}p\"{a}n tukirakenteen pett\"{a}misen nestevirtausta vastaan.     \end{document}      which is seen as ![enter image description here](http://i.stack.imgur.com/3NAGC.png) The problem is that some sentences go over the line width like **pettämisen**. The problem seems to be with words which has letters `\"{a}`. **How can you cause normal cutting of words to new lines with sentences of having A with dots?**


title: nomencl: left alignment for description text

text: Does anyone know how to left align the description text of abbrevations in a nomencl list of abbrevations. For example: I would like to left align the text "Kategorien- und Variablebezeichnungen" or "absolute Häufigkeit" in the following example. At the moment this text is justified. Thanks to all!               \documentclass[     a4paper,%     headings=small,%     ]{scrbook}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[ngerman]{babel}     \usepackage{multicol}     \usepackage{ifthen}          %Abkürzungsverzeichnis     \usepackage[intoc]{nomencl}     \let\abk\nomenclature                                \renewcommand{\nomname}{Abkürzungsverzeichnis}       \setlength{\nomlabelwidth}{.20\hsize}                \renewcommand{\nomlabel}[1]{#1 \dotfill}     \setlength{\nomitemsep}{-\parsep}                    \RequirePackage{ifthen}                              \renewcommand{\nomgroup}[1]{%     \ifthenelse{\equal{#1}{S}}{\medskip\item[\textbf{Statistik}]}{%     \ifthenelse{\equal{#1}{K}}{\medskip\item[\textbf{Notationskonventionen}]}}}     \renewcommand*\nompreamble{\setlength{\columnsep}{5pc}\begin{multicols}{2}}     \renewcommand*\nompostamble{\end{multicols}}     \makenomenclature          \begin{document}     \printnomenclature[3.2cm]          \abk[S]{n}{Stichprobengröße}     \abk[S]{H\textsubscript{n}}{absolute Häufigkeit}     \abk[K]{\frqq\dots\flqq}{Kategorien- und Variablebezeichnungen}     \abk[K]{\textit{Kursivdruck}}{Objektsprache}          \end{document}


title: How to decrease space height (margin) between equations

text: I want to decrease spaces(margin) height before and after equations because I found big space when text end and display formula appears or between equations each in separate line. Also I want to do the same between caption text and table there is also big space. All of this in `elsarticle` class.


title: How not to show a label under a graph using subfloat -- restart numbering of labels

text: I have this code:               \documentclass{beamer}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage[caption=false]{subfig}          \graphicspath{{/folder/images/}}          \title{}     \author{}          \begin{document}               \begin{figure}     \centering          \subfloat[][]{\includegraphics[scale=0.5]{Graph1}}          \end{figure}          \end{document}      Under the graph it shows me a label , "a". How can I not show it? Also, how to restart numbering of labels because the subfloat numbers all the figures from the beginning of the document?


title: hyperbola curve and its arc

text: I would like to make the following diagram: ![enter image description here](http://i.stack.imgur.com/OIijV.jpg) How could I make it? I find it difficult create the hyperbola's arc.


title: How to type NOT \delta and NOT \ll

text: In proximity theory, we use `\delta` and `\ll` as binary relations on the power set of a set X. How can one display NOT `\delta` or NOT `\ll` similar to how we can do `\not\in`. Using `\not\delta` and `\not\ll` place the strike- through in bad positions over the `\delta` and `\ll`. For NOT `\delta`, I am currently using   * `\\!\\!\not\\!\delta` For NOT `\ll`, I am using   * `\hskip 0.4mm \not \hskip -0.4mm \ll` There are a few problems here. Sometimes the placement of the "not" over the "delta" is a little off but it varies throughout the pages. Also, at the end of the line, I may get the `\not` appearing at the end of the current line and the `\delta` appearing at the beginning of the next line. I have not noticed this issue with my defininition of NOT `\ll`. What is the best way to define these symbols? How can one make sure that the "not" is on the same line as the "delta"?


title: removing the full stop after "excercise"

text: So I am doing a homework assignment. The homework is selected numbers from various pages of the textbook. So I can not use a ordered list, ie. 1, 2, 3, ... So I was looking at some ways to separate and give my solutions a heading. The best I could find was               \begin{xca}     \textbf {24 Page 45}         ...     \end{xca}      but that dosn't look very good since it puts a period after "excercise". I have attached a picture. I am either looking to get rid of the fullstop, or some alternate way. It would be best that if I create a pdf (and a table of contents) to go along with it, it should have the title as a clickable link. But if thats too complicated, help me remove the fullstop. I am using Lyx. Thanks ![enter image description here](http://i.stack.imgur.com/91UZw.png)


title: Why do some commands use []s, some use {}s, and some use both?

text: I find it confusing to remember which commands take `{}` arguments, and which ones take `[]` arguments. Is there a rule-of-thumb or semantic difference between these two? If so, what? (Because they seem to serve the same purpose to me.)


title: Using \ifdraft like \iffalse

text: Note: I don't think the `ifdraft` package provides exactly what I'm looking for, but it could be wrappered (I just don't know how :-) ) I'd like to do this:               \ifdraft     ... pgf graph component that's only for me     \fi      I'm currently using `\iffalse` and `\fi`, but it's obviously more clunky to change 20 locations instead of one. I'm trying to avoid `\ifdraft{do x}{do y}` because 1) it's uglier and therefore less readable 2) 95% of my use cases would be `\ifdraft{do X}{}`. If there's a way to wrapper `ifdraft{do X}{}` into `\ifdraft X \fi` that would be perfect!


title: Is there a tikz style for putting math in all nodes?

text: I'm finally trying out TikZ and am already infected with its programmatic philosophy. I would like to be able to do something like               every node/.style = {math mode}      (which is wrong) so that I can omit the $...$ inside the text of my nodes. This is not just for convenience; without it, the equally appealing setting               every node/.style = {font=\scriptstyle}      is wrong (the `\scriptstyle` goes outside the math mode), and I can certainly find a use for math nodes set in small text. I know I can get this, sort of, with the `matrix` library (using a `matrix of math nodes`), but I am resisting using matrices. I really like the idea of relational positioning and I hate all the empty &'s that complex use of matrices always requires. So, is this possible? How does `matrix of math nodes` achieve its effect?


title: How to remove the paragraph break after lipsum block?

text: Usually I use the `lipsum` package to produce random text. But sometimes I want to test something just after the text (e.g. some `\hrulefill` command). I noticed that `\lipsum[1]` ends with a `\par` or `\newline` or something similar. How to avoid this so that `\lipsum[1]\hfill{foo}` works like `foo\hfill{foo}`?


title: ntheorem and theoremname

text: I'm using `ntheorem` (mostly for `thmmarks`), and I'd like to change the font used for the theorem name. Specifically, I'd like > `\begin{theorem}[Name of theorem]` to generate "Theorem 1 (Name of theorem)" with only "Theorem 1" in bold (I think this is the default style in `amsthm`). Is there any easy way to do this?               \documentclass{article}     \usepackage{ntheorem}     \theoremstyle{plain}     \theorembodyfont{\itshape}     \theoremheaderfont{\normalfont\bfseries}     \theoremseparator{.}     \newtheorem{theorem}{Theorem}     \begin{document}     \begin{theorem}[Name of theorem]     $1 + 1 = 2$.     \end{theorem}     \end{document}


title: Globally changing math line spacing

text: In multiline formulas, I often find myself inserting extra vertical space (`\\\\[...]`) between lines (especially when there are many superscripts and subscripts). I guess a certain amount of manual spacing will always be necessary, but if I could increase the default that would decrease the amount of fiddling necessary for many of my documents. How can I increase line spacing in equations, leaving normal text unaffected?


title: How do I insert text into the footline of a specific slide in Beamer?

text: I'm trying to insert references into a `beamer` footline. These references are different for each slide, so I cannot include them in the footline template - unless there is then some way to later define them per-slide. I have tried to simply include the after a `\vfill`, but the location of the line then varies with each slide, and this is not what I want. How do I insert references (or really, just any custom text) into the footline of a specific slide in `beamer`?


title: Replace spaces/tabs in an imported .txt file upon import?

text: I read the answers to this question: Import a text file into LaTeX document, and am now wondering if it's possible to let TeX replace tabs or spaces in that text-file with `&` for example if you export some data in comma or tab separated values from another source. I do realize that it's simple to do that in any any text editor, but it would be convenient if some changes needed to be done on the source, not having to modify that text file over and over after exporting.


title: Pgfplots jump mark error when plotting a floor function

text: For some weird reason the following code gives me the wrong plot               \documentclass{article}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}      \addplot+[jump mark left,samples at={2.5,5,...,20}] {floor(x/2.5)};     \end{axis}     \end{tikzpicture}     \end{document}      ![the resulting plot](http://i.stack.imgur.com/yUOo7.jpg) Clearly, at for instance `x=15`, y should equal to 6. Is this a bug? **Added:** I've noticed that the `floor()` function is superfluous in this case - the `jump mark left` option works just like a floor function, which produces the correct graph. Still, this does not justify the above erroneous example.


title: LaTeX characters: dots and overlines combined

text: For alphabets with dots one has `ö=\"o`, but I would like to introduce another horizontal line just above the two dots. The command `\=\"o` doesn't yield the sought result.


title: Using tabularx, multirow, and parbox for line-wrapping

text: I am using a `multirow` inside a `tabularx`, but because the `multirow` doesn't wrap, I am putting the `multirow`'s text inside a `parbox` environment:               \begin{tabularx}{\textwidth}{@{}XX@{}} \toprule     blah & \multirow{2}{*}{\parbox{\columnwidth}{blah}} \\     blah & \\     \end{tabularx}      What should I put as the `parbox`'s width so that it responds to the column width that tabularx chooses?


title: Add label to textual data

text: This question is extremely basic and I know how to solve it basically but it is a workaround and I was wondering whether there is a much better way to do it - here is the problem: > I'd like to give some property (i.e. written text) a label, and I do it like > this: >   >   >     \begin{equation} >         \label{12345} >         \text{\emph{all functions considered are smooth}}. >     \end{equation} >   This way I get my desired label - but it is no good if for example the text is rather long ...


title: Amsmath, spacing, left alignment

text: It was recommended that I include `amsmath` package to use `\tag{}` (which works). When I do this however, it somehow changes my predefined spacing; I would like everything to be left aligned, no left spacing for beginning of paragraphs, single line space between all equations, all paragraphs. Sample code below; if you comment out `amsmath` line, you'll see the output I was aiming for. My question is what additional commands do I use for `amsmath` to this kind of output?               \documentclass[12pt,fleqn]{article}     \usepackage{amsmath}     \setlength{\parindent}{0pt}     \usepackage{graphicx}     \usepackage{cancel}     \usepackage{listings}     \usepackage[latin5]{inputenc}     \usepackage{color}     \setlength{\parskip}{8pt}     \setlength{\parsep}{0pt}     \setlength{\headsep}{0pt}     \setlength{\topskip}{0pt}     \setlength{\topmargin}{0pt}     \setlength{\topsep}{0pt}     \setlength{\partopsep}{0pt}     \setlength{\mathindent}{0cm}          \begin{document}          Some line           \[ y = x^2 \]          Another line          \[ y = x^2  \]          \[ y = x^2 \]          One more line          \end{document}


title: \setbeamerfont for customizing content font in LaTeX beamer

text: I have a problem in which I am not sure how to modify the content (normal text) of beamer font. I only know how to modify the frametitle In which               \setbeamerfont{structure}{family=\fontUbuntu}     \setbeamerfont{frametitle}{family=\fontUbuntuLight}      done for some part of my Beamer slides. In a sidenote, the Ubuntu font for LaTeX can be downloaded here: https://github.com/tzwenn/ubuntu-latex-fonts Please assist me, thanks!


title: Table: How can I have more than one line of text into a cell?

text: I'm writing an small table with 6 rows and 4 columns. Last column is a description, so the text is in some rows wider than the wide of the page. So I need it to be written en more than one line of text. How can I do this? My code until now is the following:               \begin{table}[t]     \centering     \begin{tabular}{|c |c |c| c|}     \hline     Nº pin & Nombre & E/S & Descripción\\     \hline     1 & RXD 2 & E & Entrada del puerto UART asíncrono. Tiene una resistencia interna del pull high de 75 k$\Omega$ \\     \hline     2 & TXD & S & Salida del puerto UART asíncrono\\     \hline     3 & GND & - & Masa\\     \hline     4 & VDD & E & Alimentación principal\\     \hline     5 & VDD\_B & E & Alimentación de respaldo\\     \hline     6 & PPS & S & Salida de un pulso por segundo\\     \hline     \end{tabular}     \caption{Descripción de los pines del módulo GPS UP501}     \label{gpspintable}     \end{table}


title: Display Database Instance Relationship with TikZ

text: I'm trying to display all of my corporate database instances and their relationship to each other, so to speak the database links. I found the geometry shape `cylinder` using TikZ `\usetikzlibrary{shapes.geometric}`, but I'm new to the whole TikZ stuff and it doesn't worked out that well so I thought maybe you could help me getting something like the following figure: ![enter image description here](http://i.stack.imgur.com/B1tKx.png) There will be a ton of instances and arrows, but I hope that you guys could give me a start so that I could do the rest on my own.


title: What's wrong with this table code in beamer?

text: I've been struggling for a long while with this code trying to solve the problem there apparently is. I basically copied the code from this page http://en.wikibooks.org/wiki/LaTeX/Tables in the "Spanning in both directions simultaneously" section, and I just modified it a bit:               \begin{frame}     \begin{center}     \onslide<1->\begin{tabular}{c|c|c|c}     \cline{1-4}     \multicolumn{4}{c}{Matemáticas} \pause\\     \cline{1-4}     \multicolumn{2} {c}{Cantidad}& \multicolumn{2} {c}{Magnitud} \pause \\      \cline{1-4}     \multicolumn{1}{c} {Aritmética} & \multicolumn{1}{c}{Música} & \multicolumn{1}c}{Geometría}  & \multicolumn{1}{c}{Astronomía} \pause\\     \cline{1-4}     \multicolumn{4}{c}{Quatrivium}     \end{tabular}     \end{center}     \end{frame}      TeXStudio keeps saying:               Misplaced \omit \cline{1-4}      Missing \endgroup inserted \cline{1-4}     Missing } inserted \cline{1-4}     Missing \cr inserted \cline{1-4}      I would like that the table ends up looking like this ![enter image description here](http://i.stack.imgur.com/quvOO.jpg)


title: Avoiding blank line in every node (tikzpicture)

text: I created a box using               \tikzstyle{PBox}=[rectangle, rounded corners, fill=kopfzeile!10,        anchor=north, text=black, text width=\marginparwidth-2mm]     \put(-56,-150){\makebox(0,0)[bl]{\begin{tikzpicture}%      \node[PBox]{\small%      \singlespacing%      Wichtiger Hinweis!\\};     \end{tikzpicture}}}      I always get a blank line at the start of each PBox. How can I avoid this?


title: How to improve maintenance of starred/non starred versions of commands or environments

text: All documentations I've read about starred/non starred versions of commands recommend more or less the following way of doing (following for instance the UK List of TeX FAQ):               \newcommand{\mycommand}{\@ifstar\mycommandStar\mycommandNoStar}     \newcommand{\mycommandStar}{%       <few lines of code only for starred mycommand>       <many lines of code common to starred/non starred mycommand>     }     \newcommand{\mycommandNoStar}{%       <few lines of code only for non starred mycommand>       <many lines of code common to starred/non starred mycommand>     }      For environments, the scheme is similar (following for instance this answer):               \newenvironment{myenvironment}{%       <few lines of code only for non starred myenvironment>       <many lines of code common to starred/non starred myenvironment>     }{%       <few lines of code only for non starred myenvironment>       <many lines of code common to starred/non starred myenvironment>     }     \newenvironment{myenvironment*}{%       <few lines of code only for starred myenvironment>       <many lines of code common to starred/non starred myenvironment>     }{%       <few lines of code only for starred myenvironment>       <many lines of code common to starred/non starred myenvironment>     }      But, most of the case, there are only slight differences between starred and non starred versions and this way of doing requires to copy all changes in the common code between the two versions, which is a pain of maintenance (particularly if the common code is long). Is there a more efficient way of doing?


title: ClassicThesis text area dimensions for letter size paper

text: I am considering using ClassicThesis (among other options) for typing my course notes. The problem is that ClassicThesis is customized for A4 (and A5) paper sizes, while I need letter size paper (8.5 in by 11 in or in a more SI- friendly way, 215.9 mm by 279.4 mm). I can change the paper size simply as               \documentclass[letterpaper]{scrreprt}      And as ClassicThesis is based on KOMA-Script, I can change the text area and margins using a set of commands like below as suggested in the package itself.               \areaset[current]{textwidth}{textheight}     \setlength{\marginparwidth}{length}     \setlength{\marginparsep}{length}      The question is what are the typographically correct dimensions to use? A similar question is posted here, but there's no definite answer (well, expect for checking the guidelines given by Robert Bringhurst's book, to which I don't have access.) PS. It shouldn't matter, but this is for a course in electrical engineering, which will include lots of equations and figures.


title: Section and Subsection Heading Style

text: > **Possible Duplicate:**   >  Formatting section titles How can I change the format of `section`, `subsection` and ... to something like below? **2.1 | Greenhouse Effect**


title: Specify font and font size for equations and math mode?

text: I am using a class file that defines commands to change the font and font sizes for normal text for different sections of the document, but it leaves the math mode and equation font and font sizes unchanged. Consequently, in one of the sections, all the math is huge compared to the text (and in the wrong font). How do I change the font and font size for all the math in a particular section?


title: Appendix from letter to roman numeral

text: How can I change the standard latex Appendix heading from "Appendix A" to "Appendix I" using roman numerals?


title: TikZ: Follow up to previous question no longer working

text: The code from TikZ: automatic line breaking in equal distances worked but I noticed today it isn't producing the same results. The lines aren't overlaying any more. Here are the results from `\listfiles`                *File List*     standalone.cls    2012/09/15 v1.1b Class to compile TeX sub-files standalone     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)        ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)      ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional      xkeyval.sty    2012/10/14 v2.6b package option processing (HA)      xkeyval.tex    2012/10/14 v2.6b key=value parser (HA)     standalone.cfg    2012/09/15 v1.1b Default configuration file for 'standalone'      class      article.cls    2007/10/19 v1.4h Standard LaTeX document class       size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)         tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)          pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)       pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)     everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)       pgfrcs.code.tex      pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)      ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)       pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)       pgfsys.code.tex     pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)     pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)       xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive      pgfcore.code.tex     pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)     pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)       pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)      pgfkeys.sty          pgfkeys.code.tex      pgfmath.sty          pgfmath.code.tex       pgffor.code.tex         tikz.code.tex     inputenx.sty    2011/05/27 v1.10 Enhanced input encoding handling (HO)     ix-alias.def    2011/05/27 v1.10 Alias list (inputenx)     inputenc.sty    2008/03/30 v1.1d Input encoding file         utf8.def    2008/04/05 v1.1m UTF-8 support for inputenc        t1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc       ot1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc       omsenc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc       helvet.sty    2005/04/12 PSNFSS-v9.2a (WaS)       courier.sty    2005/04/12 PSNFSS-v9.2a (WaS)       eulervm.sty    2005/01/11 v4.0 (WaS)       ot1ppl.fd    2001/06/04 font definitions for OT1/ppl.      fontenc.sty        t1enc.def    2005/09/27 v1.99g Standard LaTeX file        t1ppl.fd    2001/06/04 font definitions for T1/ppl.     textcomp.sty    2005/09/27 v1.99g Standard LaTeX package       ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file       ts1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc       ts1cmr.fd    1999/05/25 v2.5h Standard LaTeX font definitions     supp-pdf.mkii     pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)     epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf       grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)     kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)     kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)     kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)     etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)     epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live      And here is the code I am using:               \documentclass[tikz]{standalone}%     % Ensure we are not overriding any existing macro     \newcommand*{\DeltaAngle}{}     \newcommand*{\CurrentStartAngle}{}     \newcommand*{\CurrentEndAngle}{}     \newcommand*{\SegmentedArc}[5][]{%       % #1 = draw options       % #2 = number of segments       % #3 = arc start angle       % #4 = arc end angle       % #5 = radius       \draw[thin, gray] (#5, 0) arc[radius = #5, start angle = #3, end angle = #4];       %        \pgfmathsetmacro{\DeltaAngle}{(#4 - #3)/#2}%       \foreach \x in {1, ..., #2} {%         \pgfmathsetmacro{\CurrentStartAngle}{#3 + (\x - 1)*\DeltaAngle}%         \pgfmathsetmacro{\CurrentEndAngle}{\CurrentStartAngle + \DeltaAngle}%         \typeout{\string\CurrentStartAngle = \CurrentStartAngle,           \string\CurrentEndAngle = \CurrentEndAngle}%         \draw[#1] (\CurrentStartAngle: #5cm) -- (\CurrentEndAngle: #5cm);       }%     }%     \listfiles     \begin{document}     \begin{tikzpicture}       \SegmentedArc[thin, red]{4}{20}{100}{2}     \end{tikzpicture}     \end{document}      Here is the image it produces now: ![enter image description here](http://i.stack.imgur.com/BtyGJ.png)


title: Typesetting multiple TeX files

text: **Q1.** Is there an existing template with the following features: (1) Multiple files, which I can typeset individually (as and when necessary). (2) A single **.bib** file from which I can cite in different chapters, with links to the appendix and weblink. Also, this is a very basic question, please let me know how to typeset the master and individual tex files as well. **Q2.** Perhaps another silly question: can I say compile instead of typeset?


title: TikZ: automatic line breaking in equal distances

text: Is there an elegant way to break an arc into n equal pieces? I am discussing the surface area of sphere in my document, `SA = 2\pi r l`. Therefore, I want to start from an arc with n (3, 4, or 5) line segment approximations and then I will look at taking the limit of sum as n goes to infinity. I can't think of a way to break out n equal spaced lines on my arc where n is the the number I decide to go with. All I have at the moment is the arc.               \documentclass[tikz]{standalone}     \begin{document}     \begin{tikzpicture}     \coordinate (O) at (0, 0);     \draw (O) arc[radius = 2, start angle = 15, end angle = 75];     \end{tikzpicture}     \end{document}


title: Different caption styles for figures and for tables

text: I need to have different caption format for figures and for tables. Captions for figures have to be centered and captions for tables - left aligned. How to define this?


title: Date in CV in English

text: I'm translating my CV from Finnish to English. How can I change the date when I compile the file? It says 19. tammikuuta 2012 in Finnish.               \documentclass[a4paper]{amsart}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \begin{document}     \begin{center}     {\large \textbf{\textsc{CURRICULUM VITAE}}}          \today     \end{center}


title: Indentation of sections and paragraphs to show hierarchy

text: I am having troubles with the format of a work that I'm doing. The default output of LaTeX looks like:               1.1.     Section A        Latex latex latex latex.     1.1.1.   Subsection A-1        Latex latex latex latex.       But the format I want is:               1.1. Section A          Latex latex latex latex.          1.1.1. Subsection A-1                 Latex latex latex latex.      The numbers of the subsections should start in the same vertical line to the text of the section, and also I would like to decrease the spacing between the number and the text, the indentation of the paragraph too.


title: reference formatting

text: **I need my references to be formatted the same as in this image:** ![enter image description here](http://i.stack.imgur.com/1pZ1Q.png) **My .bib files look like this:**               @INCOLLECTION{Chandler2009,       author = {Chandler, R.J.},       title = {{Shorebirds of the Northern Hemisphere}},       publisher = {Christopher Helm},       year = {2009},       address = {London},       annote = {Whimbrel and Curlew account},       file = {:Users/rossahmed/Library/Application Support/Mendeley Desktop/Downloaded/Chandler - 2009 - Shorebirds of the Northern Hemisphere.pdf:pdf}     }          @BOOK{EngelmoerM&Roselaar1998,       title = {{Geographical Variation in Waders}},       publisher = {Springer},       year = {1998},       author = {Engelmoer, M. \&  Roselaar, C.S.},       pages = {214--223},       annote = {Curlew and Whimbrel section},       file = {:Users/rossahmed/Library/Application Support/Mendeley Desktop/Downloaded/Engelmoer, M \& Roselaar - 1998 - Geographical Variation in Waders.pdf:pdf}     }          @BOOK{PraterT1977,       title = {{Guide to the Identification and Ageing of Holarctic Waders}},       publisher = {BTO},       year = {1977},       author = {{Prater, T.}, Marchant.J. \& Vuorien, J.},       address = {Tring},       annote = {Curlew and Whimbrel section},       file = {:Users/rossahmed/Library/Application Support/Mendeley Desktop/Downloaded/Prater, T - 1977 - Guide to the Identification and Ageing of Holarctic Waders.pdf:pdf}     }      **Unfortunately, as I'm a beginner, the following code is as close as ive got to producing the desired results:**               \documentclass{article}     \usepackage[style=authoryear,natbib=true]{biblatex}     \addbibresource{CU1.1jabref.bib}     \begin{document}          This is my text \cite{EngelmoerM&Roselaar1998}          This is more text \cite{Chandler2009}          This is even more text \cite{PraterT1977}          \printbibliography     \end{document}      **How can I produce desired reference formatting?**


title: increment figure source names

text: In our childhood, probably all of us made some drawings on layered sheets of paper in order to make an animation. [edit: This is to be added to an existing document, next to the page number for example.] To do such an page-by-page animation in a LaTeX document of 123 pages (e.g.), I would like to include images named from "image001" to "image123" in successive pages, so that:   * page 1 includes "image001"    * page 2 includes "image002"   * ...   * page 123 includes "image123". A way to do this is would be to use a command of the form:               \includegraphics[]{\BASENAME + \PAGENUMBER + \INCREMENT}          % \BASENAME: path of folder + beginning of name     % \PAGENUMBER: page number     % \INCREMENT: number of the first page to have an image (minus one)      but I do not know how to implement such a feature.