title: Need directions on how to gain more control over graphical design of header/footers

text: I have a design of a letterhead which contains a header and a footer as seen below in ASCII-form. As you can see it contains a header and a footer which have both above and below a horizontal ruler. These rulers have color (ie: are not black) and more than 1 pixel high. Within those two horizontal ruler is text. In the header it has three text blocks, two lined out on the left, the 3rd lined out to the right. The footer just contains a line of text. Above a header is a logo, which partly falls out of the page-margins. It seems fairly simple, however I am not very advanced when it comes to LaTeX. I have many people seen recommend the `fancyhdr` package in similar cases and took a look at it, but have not yet found out what is the best to start with. Anyone who can give me at least some directions on where to look to accomplish such a thing?                                                 a logo above                                 which partly falls                                                                       of page-margin     --------------------------------------     text    text                      text     block1  block2                  block3     --------------------------------------     this is where the header has ended and     the actual page starts          with lots of text          lorem ipsum and the likes          this is where the page ends and a      footer comes in     --------------------------------------     this is a footer with some text     --------------------------------------                    page#


title: Relative column width in LaTeX

text: How can I define a tabular with two columns in LaTeX, where the first column fills 30% of the page width and the second column fills the rest?


title: Dissertation workflow/template or how to work on LaTeX while interacting with people who don't use LaTeX

text: I am starting my dissertation and I am searching for a simple yet nice template. I found a collection here but I want to make sure I find a template that meets some of these perhaps unreasonable requirements:   1. Output can an be easily converted into MS Word. I know, heresy! The thing is that I need to interact with non-LaTeX people who like to use MS Word trackchanges.    2. Output can be easily converted into XHTML. I like to publish my writings on the web, in XHTML. For example, this is conversion from PDF to XHTML had to be done manually since the automatic converters would choke with the two-column layout. So I'd like to avoid manual translation as much as possible.   3. Easily switch between one to two column layout. I'm new to LaTeX but the way I understand LaTeX stylesheets is that it is very similar to the relationship between HTML and CSS. If this is the case, then I assume it is not very difficult to simply switch stylesheets to go from 1 to 2 columns layout without having to change any of the content of the .tex file. Is this a fair representation of the situation?


title: tikz spy library with pgfplots: opacity and grid

text: When I use the tikz.spy library in order to magnify a part of my pgfplots plot with the use of grids, there are both the original grid and the magnified grid in the magnified area. screenshot: ![](http://files.droplr.com/files/55004911/YHwt.Plots-Spy-Grid.png). a part of the code looks like this:               \begin{tikzpicture} [spy using outlines={circle, magnification=3, size=2cm, connect spies}]          \begin{axis}[grid=major,axis on top, ... ]          \addplot ...          \begin{scope}[fill=white]         \spy[green!70!black,size=5cm] on (10.9,9.1) in node [right] at (3,6);     \end{scope}          \end{axis}     \end{tikzpicture}      Is it possible to have only the magnified grid in the magnified area (e.g. to set the opacity of magnified area? The `fill=white` command seems to has no effect. I tried the same with the `opacity` property. `spy using overlay` doesn't help neither. Another way would be to have the grid only in the magnified area, but I have no idea how to do. Does anyone has a solution?


title: Using a unicode-math font that looks like computer modern roman

text: I'm looking for a math font that works with the unicode-math package that looks just like computer modern roman. I found the latin modern roman font quite good, but they have a ℝ symbol which looks really ugly imo. ![enter image description here](http://i.stack.imgur.com/xGipZ.png) Is there a unicode math font that looks just like computer modern roman ? Or could I maybe replace the bbold symbols ?


title: HTML converter possible as a TeX package?

text: I know there are a lot of threads on existing Tex-HTML converters already, but I have a question about the feasibility of creating one. Existing tools use other scripting languages to parse raw TeX and output HTML. Would it be a better idea to write a package for TeX that overrides commands and outputs content to a HTML file? For instance overriding `\section` to write a `<h1>{content}</h1>` tag to another file. Is this feasible? I'm sure everyone knows more about TeX than me so I'd like to hear your thoughts.


title: document class for a restaurant menu

text: I'd like to typeset a restaurant menu. What would be a good document class or package to use? I'm hoping for an answer similar to this thread: Survey Document Class or Package?


title: biblatex-chicago + a 'seenote' cross-reference

text: I'm trying to modify biblatex-chicago to meet the idiosyncratic style of a specific journal. One thing they insist on is that subsequent citations of a work should appear in a shortened form along with a reference to the note where the full citation may be found; e.g.: Goossens, Mittelbach, and Samarin, _LaTeX Companion_ (see n. 1), 23--32. Following the advice here, I looked into `biblatex`'s `verbose-note.cbx` and made the following additions:               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage{csquotes}     \usepackage[american]{babel}     \usepackage[backend=biber]{biblatex-chicago}     \addbibresource{biblatex-examples.bib}          \renewbibmacro*{cite:save}{% <--- based on verbose-note.cbx       \csxdef{cbx@\thefield{entrykey}}{\the\value{instcount}}}          \renewbibmacro*{cite:short}{%       \ifthenelse{\ifnameundef{labelname}\OR%         \iffieldequalstr{entrytype}{inreference}\OR%         \iffieldequalstr{entrytype}{reference}}%       {\iffieldequalstr{entrysubtype}{magazine}% Simplify .bib creation         {\ifuseauthor%           {\printfield[journaltitle]{journaltitle}\isdot\newcunit}%           {}}%         {\iffieldequalstr{entrytype}{manual}%           {\printlist{organization}\isdot\newcunit}%           {}}}%       {\iffieldequalstr{authortype}{anon}%         {\bibleftbracket\printnames{labelname}%           \bibrightbracket\classicpunct}%         {\iffieldequalstr{authortype}{anon?}%           {\bibleftbracket\printnames{labelname}?%              \bibrightbracket\classicpunct}%           {\printnames{labelname}%             \isdot\classicpunct}}}%       \printtext[bibhyperlink]{%         \printfield[citetitle]{labeltitle}}%     \addspace% <--- additions start here     \mkbibparens{%       \bibstring{seenote}\addnbspace%       \ref{cbx@\csuse{cbx@\thefield{entrykey}}}}%       }%          \begin{document}          Test.%     \footnote{\cite{companion}.}%     Test.%     \footnote{\mancite\cite{companion}.}%          \end{document}      This does not work (nor have my more elaborate attempts), and I keep wasting time worrying about this when I still have revisions to do. I would appreciate any pointers as to why this solution is incomplete.


title: How to improve the decoration ends with tikz decorate

text: you will see two problems on the example below 1) how to make the plot line is not under the terminal markings 2) Why is it the text in bold               \documentclass{article}     \usepackage[latin1]{inputenc}                      \usepackage[T1]{fontenc}     \usepackage{tikz}     \usetikzlibrary{decorations.markings}          \begin{document}          \begin{tikzpicture}     \draw[decoration={markings,     mark connection node=my node,     mark=at position 0  with {\node [draw,blue,transform shape,inner sep=0,minimum size=1em,fill=white] (my node) {->};},     mark=at position 0.5  with {\arrow{stealth}},     mark=at position 1  with {\node [draw,blue,transform shape,inner sep=0,minimum size=1em,fill=white] (my node) {->};},     },decorate,green](0,0) --(3,1)node[pos=0.5,below,black,text width =5em,align=center]{signal amplifie};     \end{tikzpicture}          \end{document}      merci


title: Axis labels according to DIN461

text: DIN461 requires to put the unit of the axis between the last two ticks of an axis, see http://de.wikipedia.org/wiki/DIN_461 (sorry only in german, but the lower two images make it clear, I think) Is there an "easy" way to get the positions of the ticks for this purpose?


title: Reduce code duplication newcommand

text: I was wondering how to reduce the duplication of code when using `\newcommand`. The following code is highlights for explaining things, full TeX code can be found here and the compiled PDF here:               \newcommand\transone{\ensuremath{\ket{2,2} \rightarrow \ket{1,1}}\xspace}     \newcommand\transtwo{\ensuremath{\ket{1,1} \rightarrow \ket{2,0}}\xspace}     \newcommand\transfull{\ensuremath{\ket{2,2} \rightarrow \ket{1,1} \rightarrow \ket{2,0}}\xspace}     \newcommand\ground[1]{\ensuremath{\ket{\text{#1}}}\xspace}     \newcommand\exited{\ensuremath{\ket{\text{e}}}\xspace}      Then you can declare something like declaring a `\newmathcommand` instead:               \newcommand\newmathcommand[2]{\newcommand#1{\ensuremath{ #2 } \xspace}}      And then declare commands by               \newmathcommand\transone{\ket{2,2} \rightarrow \ket{1,1}}      to reduce redundancy. But this prevents me from passing arguments like with `\ground`. Is there a way to assemble a command that can pass arguments such that you can declare that a command takes input, like this:               \newmathcommand\ground[1]{\ket{\text{#1}}}      Best, Theis


title: Lowercase in \citet{}, uppercase in \citep{}

text: My institute's format standards require that author's name in `\citet{}` citations should appear with first letter in uppercase, whereas in `\citep{}`, all letter should be in uppercase. For example: `\citet{Wooldridge2002}` should give `Wooldridge(2002)` whereas `\citep{Wooldridge2002}` should give `(WOOLDRIDGE, 2002)`. How can I accomplish that? I tried a naive solution with `\MakeUppercase`, but it didn't worked. See example (`\bibitem` extracted from `.bbl` generated from `.bib` with our style):               \documentclass[11pt,a4paper]{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{natbib}          \begin{document}       I want the first letter of author's name in uppercase here: \citet{Wooldridge2002} (ok).            I want all letters of author's name in uppercase here: \MakeUppercase\expandafter{\citep{Wooldridge2002}} (not ok).            \begin{thebibliography}{9}       \bibitem[Wooldridge(2002)WOOLDRIDGE]{Wooldridge2002} WOOLDRIDGE, M.~J\@.       \textbf{An Introduction to Multiagent Systems}. Chichester: John Wiley \&       Sons, 2002.       \end{thebibliography}     \end{document}      EDIT: I rephrased the paragraphs in the code to reflect better my intentions.


title: Fancy box around equation

text: I am trying to get my equations to show up like: ![enter image description here](http://i.stack.imgur.com/CDuPJ.png) This is my attempt thus far:               \documentclass[11pt,fleqn]{book}      \usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry}           \usepackage{xcolor}     \definecolor{ocre}{RGB}{243,102,25}     \usepackage{avant}      \usepackage{empheq}     \usepackage{mathptmx}          \usepackage{microtype}      \usepackage[utf8]{inputenc}      \usepackage[T1]{fontenc}      \usepackage{calc}      \begin{document}          \newcommand*\Ocrebox[2][Example]{%     \sbox{\mysaveboxM}{#2}%     \sbox{\mysaveboxT}{\fcolorbox{ocre}{ocre!10}{#1}}%     sbox{\mysaveboxM}{%     \parbox[b][\ht\mysaveboxM+.5\ht\mysaveboxT+.5\dp\mysaveboxT][b]{%     \wd\mysaveboxM}{#2}%     }%     \sbox{\mysaveboxM}{%     \fcolorbox{black}{shadecolor}{%     \makebox[\linewidth-10em]{\usebox{\mysaveboxM}}%     }%     }%     \usebox{\mysaveboxM}%     \makebox[0pt][r]{%     \makebox[\wd\mysaveboxM][c]{%     \raisebox{\ht\mysaveboxM-0.5\ht\mysaveboxT     +0.5\dp\mysaveboxT-0.5\fboxrule}{\usebox{\mysaveboxT}}%     }%     }%     }          \begin{empheq}[box=\Ocrebox]     \frac{C(s)}{R(s)}= \frac{G(s)}{1+G(s)H(s)}     \label{e5}     \end{empheq}          \end{document}      I am not getting this to compile though. Any help will be greatly appreciated!


title: Alternating Background Image for different chapters in Memoir

text: I have used a background image throughout my book. The code I used evolved from this question and answer (thanks to @GonzaloMedina): "Margin vertical rule on outside margin of twosided memoir" My question is I would like to figure out how to shift the colored background box to a new location down the edge of the page for each chapter (7-10 chapters). In addition I want to place the chapter # within the colored box. Is this possible?                   \documentclass[a4paper,openany]{book}     \usepackage[contents={},opacity=0.5,scale=1,angle=90,hshift=-2.5cm]{background}     \usepackage{lipsum}          \newcommand*\VerBar[2]{%       {\color{#1}\rule{#2}{65pt}}}          \newif\ifBgUse          \AddEverypageHook{%     \ifBgUse%     \ifodd\value{page}      \backgroundsetup{position={current page.north east},vshift=32.5pt,%     contents={\VerBar{blue}{5cm}}}%     \else     \backgroundsetup{position={current page.north west},vshift=-32.5pt,%     contents={\VerBar{blue}{5cm}}}%     \fi%     \BgMaterial%     \fi}          \begin{document}          \chapter{Test chapter one}     \lipsum[1-9]\clearpage          \BgUsetrue% activate background material     \chapter{Test chapter two}     \lipsum[1-9]\clearpage          \BgUsefalse% deactivate background material     \chapter{Test chapter two}     \lipsum[1-9]          \end{document}


title: "Misplaced allignment tab character" line 53

text: \documentclass [12pt]{article}     \oddsidemargin=0pt     \topmargin=0pt     \textwidth=6.5in     \textheight=8.5in     \begin{document}     \begin{center}     {\large\bf\LaTeX\ Example 7}     \end{center}     This example demostrates two methods for typesetting piecewise defined functions.     The array structure can be used to typeset function definitions that have multiple cases:     \begin{equation}     f(x)=\left\{     \begin{array}{r@{\quad\mathrm{if}\quad} r}     %%     %%% Using r instead of i was the only way i could get the file to compile     %%     x^2-1 & x\in (-\infty,-1]\vspace{2pt}\\     {\displaystyle \frac{x^2+1}{x^2-1}}&x\in(-1,1)     \vspace{6pt}\\     x^2+1 & x\in[1, \infty) \vspace{4pt}     \end{array}     \right.     \end{equation}     \begin{quote}     \begin{verbatim}     \begin{equation}        f(x)=\left\{          \begin{array}{r@{\quad\mathrm{if}\quad} i}            x^2-1 & x\in (-\infty,-1]\vspace{2pt}\\           {\displaystyle \frac{x^2+1}{x^2-1}}&x\in(-1,1)               \vspace{6pt}\\           x^2+1 & x\in[1,\infty) \vspace{4pt}         \end{array}       \right.     \end{verbatim}     \end{quote}     Observations:     \begin{itemize}     \item The function definition is an array structure with two columns, the first one right justi-     fied, and the second one left justified \verb+(+because of the \verb+{+r\verb+@{\+quad\verb+\+textrm\verb+{+if\verb+}\+quad\verb+}+1\verb+})+.     \item The \verb+@{\+quad\verb+\+textrm\verb+{+if\verb+}\+quad\verb+}+ is called and \verb+@-+expression.  It causes the word ''if'' \verb+(+in roman font\verb+)+ to be inserted between the first and second columns.  The \verb+\+quad causes one space proportional to the current font size to be inserted.     \item The \verb+\+displaystyle increases the font size in the fraction of the second line of the     definition.  Without it, the expression in the second line appears disproportionately small.     \item The two \verb+\+vspaces insert some vertical spaces between the alternative cases of the      function definition.     \item Note that \verb+\+left\verb+\{+ is balanced with \verb+\+right . .     \end{itemize}     Here is another way to typeset the definition of f:     \begin{equation}     f(x)=     \begin{cases}       x^2-1                                                 & \text{if $x\ in(-\infty,-1]$}\\     {\displaystyle \frac{x^2+1}{x^2-1}} &\text{if $x\in(-1,1)$}\\     x^2+1                                                  &\text{if $x\in[1, \infty)$}     \end{cases}     \text{\ \ \ .}     \end {equation}     \begin{quote}     \begin{verbatim}     \begin{equation}     f(x)=     \begin{cases}     x^2-1                                                   &\text{if $x\in(-\infty,-1]$}\\     {\displaystyle \frac{x^2+1}{x^2-1}} &\text{if $x\in(-1,1)$}\\     x^2+1                                                  &\text{if $x\in[1, \infty)$}     \end{cases}     \text{\ \ \ .}     \end {equation}     \end{verbatim}     \end{quote}     \end{document}


title: Reduce space before header in scrbook class

text: In srcbook class, no matter how i set top margin (neither `geometry` nor `\addtolength` work) it always adds huge space before header. Some people suggested to change `@makechapterhead` definition but `scrbook.cls` contain several entries and i don't know which one i have to change.


title: Resizing a table by textheight

text: Say, I have a table which doesn't fit on one page. Say, I don't want to use any special table types or so but want to solve the problem by using the `\resizebox`-command and keep my ratio. If by using `\resizebox{\texwidth}{!}{...}` the table fits, then my problem is solved. But if the table is still too long, my instinct would be to use `\resizebox{!}{\textheight}{...}` instead. Allowing some space for my caption I would have to adjust the height to about `0.9\textheight` to be sure for a single line caption. But in my example I have ta adjust to approx. `0.48\textheight` to get rid of all warnings and fit the table on the page. This seems very odd to me. What am I missing?               \documentclass{article}     \usepackage{graphicx}          \begin{document}     \begin{table}[htbp]     \centering     %   \resizebox{\textwidth}{!}{         \resizebox{!}{0.48\textheight}{             \begin{tabular}{|lll|}\hline                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\                 TextTextTextTextTextText & TextTextTextTextText & TextTextTextTextText\\ \hline             \end{tabular}}         \caption{test}     \end{table}     \end{document}


title: Install font easily - product integral?

text: Is there a way to install fonts easily from a tar.gz file? I'm looking to install http://www.math.leidenuniv.nl/~gill/prodint.tgz. The README states: >   1. Copy "`prodint.tfm`" and "`prodint.pfb`" where the LaTeX fonts live. > >   2. Add to your "`fonts.map`" (usually in > "`/usr/share/texmf/dvips/config`") the entry: >   >     >     prodint prodint < prodint.pfb >   > >   3. Copy "`prodint.sty`" where LaTeX can see it. > >   4. Execute ``mktexlsr`' or whatever you need to do to update the ls-R > file. > > > > "`prodint.sty`" defines the product-integral symbol in three sizes: >   >   >     \prodi   ----- text >     \Prodi   ----- display >     \PRODI   ----- big >   > > check "`prodint.ps`" to see how these look like. > > You can generate "`prodint.ps`" without installing the LaTeX `prodint` > > files by typing >   >   >     latex prodint; dvips -o prodint.ps -P prodint prodint >   > > in this directory. I'm on Ubuntu, and I'd like a process to install this easily whenever I'm on a new computer. Or can I create a LaTeX package somehow so I can have this font installed easily? Additional information about further definition that I need to define in my LaTeX source file to get it working is here http://wiki.contextgarden.net/Product_integral. I'd like to be able to do something like `\usepackage{prodint}` and be able to use the commands. Let me know if this is possible. Thanks!


title: Is there a list of general use LaTeX kernel macros?

text: Here are a few cases in which one could use such a list:   * Is there a "prepend" version of `\g@addto@macro`? A "local" version?   * What's the most efficient way of gobbling n characters?   * Can I use LaTeX's internal macros to define my own starred commands? etc.


title: Package and/or macro for producing a bi-lingual dictionary/glossary?

text: A use case is simple, say you write a computer science text book for pirates. Then, each time you mention a term, you may need to mention its English equivalent. So, instead of writing,                Ye first proggie today will be ``Ahoy, World!''      You would like to write:                Ye first \term{proggie} today will be ``\term{Ahoy}, World}!''      where, in a separate file, you make a list of all terms, and their English equivalent, e.g. `\termdef{ahoy}{hello}`, and `\termdef{proggie}{program}`. The `\term` macro (use of the word in context) should do the following:   1. Add a footnote of the English equivalent.   2. Add itself to a Pirates-to-English dictionary   3. Add itself to an English-to-pirate dictionary. Now, it seems as if the `glossaries` package can almost do that. The main difficulty is in dealing with word forms. `glossaries` can do plurals, but the Pirates language has many more word forms, e.g., you could write in your term definitions file,               `\termdef{progie}{program}`     `\termdef{progee}{program}`      Or better yet, instead of defining all possible word forms, have the text mention the principal formthe text, refer to the principal form of the word.               After writing the \term[progie]{progee}, you have to compile it.      What I would like is that the the first footnote includes the principal word form, not the current variant. Also, I am not sure as to how I should use the package to produce two glossaries instead of one, each with its own sorting. (A previous question dealt with a similar topic (Icelandic vs. Pirates), but the difficulties remain: first footnote should mention the principal form of the word, and the issue of producing two glossaries instead of one.)


title: MetaPost: Adjust colour value (brightness/luminosity)

text: # Background In MetaPost, colours can be lightened or darkened by calling the transparency function. However, this allows other colours to show through, which isn't necessarily desirable all the time. Sometimes a colour should be lightened or darkened independently of its transparency, by changing its **value**. # Problem Colours can be adjusted in MetaPost with multiplication, such as:               \definecolor[BaseColour][h=66CEF1]          \startuseMPgraphic{page:ThemeElement}       color baseColour;       baseColour := .5 * \MPcolor{BaseColour};     \stopuseMPgraphic      However, that changes the **saturation** , and possibly the **hue** as well. # Question In MetaPost, how do you control a colour's **value** , **saturation** , and **hue** , independently? # Related The following ConTeXt code illustrates, conceptually at least, what I'd like to do in MetaPost:               \definecolor[BaseColour][h=66CEF1]     \definespotcolor[BaseColourSaturation][BaseColour][s=.625]     \definespotcolor[BaseColourValue][BaseColour][value=.625]     \definespotcolor[BaseColourHue][BaseColour][hue=.625]      The MetaPost Applications manual defines:               SetupColors( auto-SV, shading-SV, grayscale )      From the mailing list:   * http://www.ntg.nl/pipermail/ntg-context/2011/063073.html It appears that these functions all render the same output when viewed in Evince (the PDF reader I am using). From the manual you can employ a complementary factor:               .7[red,white]      For example:               fill unitsquare scaled 1cm withcolor .7[red,white];      However, this does not provide enough control.


title: Make use of two BibTeX libraries in one document

text: I am trying to make use of two bibtex libraries in the same document for my thesis:   * one for books (filename: literatur.bib)   * one for internet resources (filename: internetquellen.bib) but on running bibtex, I always get the following errormessage:               Processing: Thesis.aux          This is BibTeX, Version 0.99d (TeX Live 2010)          The style file: geralpha.bst          Database file #1: internetquellen.bib          Warning--I didn't find a database entry for "unlockinandroid"          Found 0 errors, and 1 warnings in 0 runs      ...which leaves the conclusion that the literatur.bib is not processed (the key "unlockinandroid" is in the literatur.bib ), although in my thesis.tex I have it declared before the "internetquellen.bib":               \addchap{Listings}          \renewcommand{\bibname}{Bibliography}     \bibliographystylelit{geralpha}     \bibliographylit{literatur}     \addcontentsline{toc}{section}{Bibliography}               \renewcommand{\bibname}{Internet Resources}     \bibliographystyle{geralpha}     \bibliography{internetquellen}     \addcontentsline{toc}{section}{Internet Resources}      My literatur.bib looks like this:               @book{unlockinandroid,         Author = {W. Frank Ableson, Robi Sen, and Chris King},         Date-Added = {2011-03-15 15:40:31 +0100},         Date-Modified = {2011-03-18 12:35:41 +0100},         Keywords = {Android, Book},         Publisher = {Manning Publications Co.},         Title = {Unlocking Android - a developer's guide},         Year = {2009}}      Any directions for solving this would be appreciated:)


title: BibTeX reference formats in JabRef and LyX

text: I am using JabRef for my references. I export them as a `.bib` file and import them into LyX. They are all sorted correctly and referenced fine in the text. However, when I look in the actual bibliography section of my paper they look pretty ugly: some have URL's, some have extra spaces that look unprofessional. Is there a way to make all of the references that are printed have the same fields and format? MWE: Here are two bibtex entries:               @ARTICLE{ADRIAN2008,       author = {Adrian, Tobias And Rosenberg, Joshua},       title = {Stock Returns and Volatility: Pricing the Short-Run and Long-Run         Components of Market Risk},       journal = {The Journal of Finance},       year = {2008},       volume = {63},       pages = {2997--3030},       number = {6},       doi = {10.1111/j.1540-6261.2008.01419.x},       issn = {1540-6261},       owner = {home},       publisher = {Blackwell Publishing Inc},       timestamp = {2013.01.31},       url = {http://dx.doi.org/10.1111/j.1540-6261.2008.01419.x}     }          @ARTICLE{Ang2006,       author = {Ang, Andrew and Chen, Joseph and Xing, Yuhang},       title = {Downside Risk},       journal = {Review of Financial Studies},       year = {2006},       volume = {19},       pages = {1191-1239},       number = {4},       abstract = {Economists have long recognized that investors care differently about     downside losses versus upside gains. Agents who place greater weight     on downside risk demand additional compensation for holding stocks     with high sensitivities to downside market movements. We show that     the cross section of stock returns reflects a downside risk premium     of approximately 6% per annum. Stocks that covary strongly with the     market during market declines have high average returns. The reward     for beasring downside risk is not simply compensation for regular     market beta, nor is it explained by coskewness or liquidity risk,     or by size, value, and momentum characteristics. (<I>JEL</I> C12,     C15, C32, G12)},       doi = {doi:10.1093/rfs/hhj035},       owner = {home},       timestamp = {2013.01.31},       url =     {http://www.ingentaconnect.com/content/oup/revfin/2006/00000019/00000004/art01191}     }      The LyX file:               %% LyX 2.0.5.1 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[11pt,openbib]{article}     \usepackage[latin9]{inputenc}     \usepackage{geometry}     \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}     \setlength{\parskip}{\medskipamount}     \setlength{\parindent}{0pt}     \usepackage{amsmath}     \usepackage{amssymb}     \begin{document}     \bibliographystyle{plainnat}     \nocite{*}     \bibliography{C:/Users/home/Desktop/test}          \end{document}      It does look like part of the problem is that some entries have more information than others: ie URL's, etc. Do I have to edit each one or can BibTeX be run to only display certain aspects of an entry to make them all the same?


title: Subfigure link in List Of Figures don't redirect to the subfigure

text: I'm having some problems with my List Of Figures. I have a couple subfigures in my report, and when I go to the list of Figures, the link for the main caption works well and redirects to the right page. But when I click on the link on one of the captions of the subfigures, I get redirected to the 1st page of my report. Is there a way to make the link from the subfigure's caption redirect to the subfigure itself ? Here's my code :               \documentclass{book}     \usepackage[lofdepth,lotdepth]{subfig}     \usepackage[colorlinks=true,linkcolor=blue,urlcolor=NavyBlue,citecolor=Fuchsia,linktocpage]{hyperref}     \begin{document}     \Chapter{Coucou toi}     \begin{figure}[H]     \centering     \subfloat{     \includegraphics[\textwidth]{Fig1.jpg}     \label{fig:Figure1}}     \qquad     \subfloat{     \includegraphics[width=0.6\textwidth]{Fig2.jpg}     \label{fig:Figure2}}     \caption[Blabla]{Bloblo\protect\footnotemark}      \label{fig:Figure}     \end{figure}     \footnotetext{Source : \itshape{\url{http://www.coucou.com}}}     \noindent     \end{document}      Don't know if it helps, but when I compile I get the error : `name{subfigure.3.3}` has been referenced but does not exist, replaced by a fixed one"


title: tabular margin left overflow

text: I try to build a tabular with latex and experience a little overflow of the horizontal line on my tabular on the left. whatever I tried everything just switched the overflow so it sometimes happens on the right side and with other configurations, like shown, on the left. It's just about 1 mm but that shouldn't be... Heres the code that procudes it:               \begin{table}[H]     \centering             \begin{tabular}{|l||p{10cm}|}             \hline             \textbf{Risikobeschreibung} & xyz\\             \hline             \textbf{Auswirkungen}   & xyz\\             \hline             \textbf{Warnzeichen}    & xyz\\             \hline             \textbf{Eintrittswahrscheinlichkeit}    & xyz\\             \hline             \textbf{Vermeidungsstrategie}   & xyz\\             \hline             \textbf{Maßnahmen bei Eintreten} & xyz\\             \hline\hline             \end{tabular}             \caption{Risikoanalyse}             \label{tab:Risikoanalyse}          \end{table}      ![Overflow of margin on left side just about 1mm long very tiny](http://i.stack.imgur.com/J563L.png) Hope you can see it on the image.


title: A notation for continued fractions

text: http://www.math.illinois.edu/~berndt/gausslandenmonthly.pdf On page 602 of this linked document (which is the 19th of 25 pages) there appears a notation for continued fractions which has been fairly conventional and found in many books and papers over quite a few decades: ![enter image description here](http://i.stack.imgur.com/owsJf.png) The "+" sign is at an only slightly higher level than the denominators. How can that be done in LaTeX?


title: What variable contains the word "Appendix" when a chapter is an appendix?

text: I've designed a whole new fancy chapter header layout, and have hard coded the word "Chapter" in there before the chapter number. I just realized now that this won't work because I have an appendix named "Chapter A". Is there a variable that will contain the word Chapter or Appendix depending on which it is typesetting at the moment? `\chaptername` only seems to have the word "Chapter" even though I'm using it under the appendix section. **Edit:** I've got it working in my chapter headers, thanks to answers below; but my TOC isn't working properly. I've changed my TOC with `titletoc`, and it still says "Chapter" even though I've got the following code:               \documentclass{book}     \usepackage{titletoc}     \usepackage{color}          \makeatletter     \titlecontents{chapter}[-2em]         {\color{cyan}\bfseries\LARGE\addvspace{3mm}}         {\@chapapp \contentslabel{-0.25em}\hspace{2em}}         {}         {\hspace{3em}\contentspage}     \makeatother          \begin{document}         \tableofcontents         \chapter{test}         \appendix         \chapter{asdf}     \end{document}


title: What are good packages / techniques for writing more readable LaTeX *code*?

text: A while ago I stumbled upon the `semantic` package --- its 'math ligatures' feature in particular --- and the whole way in which I write math-code in LaTeX changed. Instead of               \[       \sem{\sigma}_s^x \quad \defeq \quad         \setbuild           { \sigma' \subseteq \Sigma }           { \exists s' \in S: \config{s, \sigma} \longrightarrow \cdots \longrightarrow             \config{s', \sigma'} \land x \in \sigma' }     \]      (already cleaned up with specific-purpose macros) I can now write               \[       [[ \sigma ]]_s^x  =def         \setbuild         { \sigma' <=set \Sigma }         { .E. s' .in. S: <( s, \sigma )> --> ... --> <( s', \sigma' )> .and. x .in. \sigma' }     \]      and get an identical result (MWE upon request). **Question:** I was wondering if there are other packages like that: packages that make your (La)TeX code easier to read. (Perhaps even a replacement for `semantic` itself because, truth be told, that package is somewhat old and a bit buggy here and there.) **Edit:** Please note, I'm interested in _any_ package meant to enhance source code readability. It doesn't have to be anything like my example. Several other questions exist concerning code readability, but none of them focus on packages.


title: Simplify how I write my address in documents

text: Often when writing letters and articles, I need to print my address at the beginning or end of the document. I do this in the following ugly way:               \documentclass{article}     \begin{document}     \noindent My name\\     \noindent My university\\     \noindent My department\\     \noindent My address\\     \noindent My e-mail\\     \end{document}      Clearly there must be a better way to do this than having to repeat `\noindent ... \\` for every line. I'm thinking I could define a new command `\myaddress` that will simply print all of those lines:               \documentclass{article}     % define address command here     \begin{document}     \myaddress     \end{document}      Or at the very least define a new environment that takes care of the indentation and line break:               \documentclass{article}     % define address environment here     \begin{document}         \begin{address}             My name             My university             My department             My address             My e-mail         \end{address}     \end{document}      But I have no idea how to do either.


title: amsmath bullet has everything in italics following bullet

text: LaTeX noob question: I would like to type `a bullet b = 55`. For this I am doing `a\bullet{b} = 55`. However, everything after bullet is in italics. Not sure if I wrote the correct syntax.


title: lstlisting wrongly parse code as stringstyle (language = R)

text: please have a look at this picture. Could someone help me solve this please? ![enter image description here](http://i.stack.imgur.com/pazuN.png) As you can see, lstlisting sees my code chunk as string, which should not be the case (only stuff in quotes should be in mauve). Here's a minimal example:               \documentclass{report}          \usepackage[usenames,dvipsnames]{color}     \usepackage{listings}     \definecolor{mauve}{rgb}{0.58,0,0.82}          \lstset{ %       language=R,                     % the language of the code       basicstyle=\footnotesize,       % the size of the fonts that are used for the code       numbers=left,                   % where to put the line-numbers       numberstyle=\tiny\color{Gray},  % the style that is used for the line-numbers       stepnumber=1,                   % the step between two line-numbers. If it's 1, each line                                       % will be numbered       numbersep=5pt,                  % how far the line-numbers are from the code       backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}       showspaces=false,               % show spaces adding particular underscores       showstringspaces=false,         % underline spaces within strings       showtabs=false,                 % show tabs within strings adding particular underscores       frame=single,                   % adds a frame around the code       rulecolor=\color{black},        % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. commens (green here))       tabsize=2,                      % sets default tabsize to 2 spaces       captionpos=b,                   % sets the caption-position to bottom       breaklines=true,                % sets automatic line breaking       breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace       title=\lstname,                 % show the filename of files included with \lstinputlisting;                                       % also try caption instead of title       keywordstyle=\color{blue},      % keyword style       commentstyle=\color{ForestGreen},   % comment style       stringstyle=\color{mauve},         % string literal style        escapeinside={\%*}{*)},         % if you want to add a comment within your code       morekeywords={*,...}            % if you want to add more keywords to the set     }          \begin{document}     \begin{lstlisting}       x3 <- scan(filenames[i], what = "", nlines = 1, sep="\n", quote = "\"",skip=data.row)  #Reads first line of data as text       csvtype <- grepl(",",x3) #Checks for existance of "," in x3       if (csvtype ==TRUE)       {         seperator=","       } else {         seperator=";"       }     \end{lstlisting}     \end{document}


title: a xe(la)texify script for WinEdt 6

text: I like how WinEdt has a PDFTeXify script, with an associated button, which re- runs everything necessary until you get a PDF, and also opens the PDF in a viewer. I want the same thing for XeTeX, but I'm finding it a bit difficult to make heads or tails of the PDFTexify script source. Has someone written such a script I might use? Also, supposing I have it, can it be easily added to the menus, i.e. with something like               ITEM="-"     ITEM="PDFTeXify"       CAPTION="XeTLaT&eXify"       IMAGE="TeXXeLaTeX"       SAVE_INPUT=1       MACRO="Exe('%b\Exec\TeX\XeLaTeXify.edt');"       SHORTCUT="24656::Shift+Ctrl+e"       REQ_FILTER=:something...      ?


title: Change the path where (the internal viewer of) TexStudio looks for the generated PDF file?

text: I've changed almost all TextStudio commands to generate temporary files into a different build directory. I need this behavior because I'm syncing the source directory with the cloud and this way I can avoid unnecessary network activity (temp files sync). All works fine and the directory containing the .tex files remains clean. However the internal PDF viewer doesn't work anymore. It still looks for the PDF in the same directory where the original .tex file is located. Is there any wat to setup the internal viewer to look into the build folder?


title: Problems with quoting package and renewing quotation environment

text: Following this How to modify spacing around quotation environment? ...I have tried to use both given solutions (using `quoting` package and renewing `quotation` environment). I cannot use `quoting` package (MiKTeX does not find it, it is recognized by the newest version of MiKTeX but I am finishing my thesis so do not want to ruin my previous work by updating MiKTeX or do anything as such :) - I am not a pro etc. ;)), so I have tried this:               \renewenvironment{quotation}                    {\list{}{\listparindent=0pt%whatever you need                             \itemindent    \listparindent                             \leftmargin=0pt%  whatever you need                             \rightmargin=10pt%whatever you need                             \topsep=0pt%%%%%  whatever you need                             \parsep        \z@ \@plus\p@}%                     \item\relax}                    {\endlist}      However it does not work. I have got this in the log file:               ! Undefined control sequence. ...tmargin =10pt\topsep =0pt\parsep \z      @ \@plus\p @ l.319 \begin{quotation}      **EDIT: the solution is to not miss the \makeatletter before the code and \makeatother after the code (I did not include the full code)** Have you any ideas, why I cannot use it? Or how to define spaces (mainly - block stretching it) between `quotation` environment and paragraphs (the spaces are not the same in different quotations in the text, sometimes the space is uneven before and after quotation or the space is huge, so the output does not look good as it should and I have to add or reduce `vspace`, which is probably the worst solution taking into account why I use `TeX`).


title: How to scale all mathematics of a document

text: > **Possible Duplicate:**   >  Equations, change the font size   >  How to scale math font only I am very new to LaTeX. I want all mathematics(i.e. the thing we write inside `$...$` and `\[...\]`) of my document to be shown larger than the other texts. How can I do it? edit:here is an worked example:               \documentclass[14pt]{article}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage[xetex]{graphicx}     \usepackage{fontspec}     \usepackage[margin=2cm]{geometry}     \author{Adib}          %Defining fonts     \font\e="Times New Roman" at 12pt     \font\lb="SolaimanLipi-Bold:script=beng" at 22pt     \font\b="SolaimanLipi:script=beng" at 14pt     \font\bl="SolaimanLipi-Bold:script=beng" at 14pt     \begin{document}     \title{\lb{অণুসম গণিত}}     \date{}     \maketitle     \b{নাম্বার থিয়োরি ভালোবাসেন কিন্তু কনগ্রুয়েন্স বা অনুসমতা সম্পর্কে ধারণা নেই এমন মানুষ একটিও সম্ভবত এই ধরাধামে খুঁজে পাওয়া যাবে না। কারণ ক্লাসিক্যাল নাম্বার থিয়োরির খুব বড় একটি অংশই যে রয়েছে এই মডুলার এরিথম্যাটিকের দখলে।          এবার ভূমিকা ছেড়ে মূল আলোচনায় আসা যাক। $a$ এবং $b$ সংখ্যা দুটিকে যদি $c$ দ্বারা ভাগ করে একই ভাগশেষ পাওয়া যায় তবে বলা হয়} \bl{$a$ এবং $b$ হচ্ছে $c$ ভাজকের সাপেক্ষে অনুসম বা কনগ্রুয়েন্ট।} \b{কিংবা গণিতের ভাষায় $a\equiv b\; (\bmod\; c)$}     \b{ পড়তে হয়} '\e{$a$ is congruent to $b$ modulo $c$}'     \end{document}


title: longtable: Keeping some cells together on the same page

text: I'm using longtable in my CV to list work experience, so it can continue over multiple pages. However I like to keep some rows together, such as employer and job title, is there a way how I can do this?


title: \nocite{*} for single bibdatasources with biblatex/biber

text: Several bibliography resources are used in one single tex-document. They resources have been added using: \addbibresource{}. Now I'd like to use the \nocite{*} command to print all references of one of the bibresources. However \nocite{*} does consider all resources instead of just a single source (in the case of the example it should be resource2). Is there a way to specify that with \nocite{*}?               \RequirePackage{filecontents}     \begin{filecontents*}{\jobname-resource1.bib}     @article{A2014,     author={First Author},     journal={Journal A},     title={First Paper},     year={2014}     }     \end{filecontents*}     \RequirePackage{filecontents}     \begin{filecontents*}{\jobname-resource2.bib}     @article{B2014,     author={Another Author},     journal={Journal B},     title={Second Paper},     year={2014}     }     @article{C2014,     author={Next Author},     journal={Journal C},     title={Third Paper},     year={2014}     }     \end{filecontents*}          \documentclass{article}                        %bib     \usepackage[backend=biber,style=authoryear]{biblatex} % load the package     \addbibresource{\jobname-resource1.bib}     \addbibresource{\jobname-resource2.bib}          %%%%%%%%%%%%%%%     \begin{document}          This is a citation \cite{C2014}     \nocite{*}          \printbibliography           \end{document}


title: captionsetup url color select

text: I've changed my caption font color to gray as seen in the screenshot below. My problem is that references is black (which I've chosen in the `hypersetup`), how do I change this to be gray as the rest of the caption text, while in all other places than the caption the links are black? I've tried with `linkcolor` and `urlcolor`, but it seems like the caption package does not support these options. ![enter image description here](http://i.stack.imgur.com/p0s3f.png) Here is my preamble:               \documentclass[11pt, twoside]{report}          \usepackage{hyperref} % clickable references     \hypersetup{         colorlinks,         citecolor=black,         filecolor=black,         linkcolor=black,         urlcolor=black     }               % ------- Images ------- %     \usepackage{graphicx}     \usepackage{caption}     \usepackage{subcaption}     \DeclareCaptionFont{gray}{\color{gray}}     \captionsetup{         textfont={footnotesize,sc,gray},         font={footnotesize,sc,gray},         %linkcolor={footnotesize,sc,gray},     }                    % ------- Colors ------- %     \usepackage{color}     \definecolor{dkgreen}{rgb}{0,0.6,0}     \definecolor{gray}{rgb}{0.5,0.5,0.5}     \definecolor{mauve}{rgb}{0.58,0,0.82}      And the code for the table and equation is here:               \begin{equation}     1+K_1K_2\frac{(s+2)^2}{(s+10)(s+100)(s^2+3.535s+6.25)}=0     \label{eq:part_b_characteristic_eq}     \end{equation}               \begin{table}[h!]     \begin{center}     \begin{tabular}{c|l}     $s_n$ & pole\\\hline     $s_1$ & $-100 + 0i$\\     $s_2$ & $-10 + 0i$\\     $s_3$ & $-1.77 + 1.77i$\\     $s_4$ & $-1.77 - 1.77i$\\     \end{tabular}     \end{center}     \caption{Pole values of the system from equation \eqref{eq:part_b_characteristic_eq}}     \label{tab:poles_from_characteristic_eq_partb}     \end{table}


title: Can I include Chinese characters in listings? If so, how?

text: I'd like to include Chinese characters in listings. Can it be done, and, if so, how?


title: Set default sans serif font in XeLaTeX

text: How can I set the default sans serif font to the default in this example in XeLaTeX? I can only get Helvetica with               \documentclass{article}          \usepackage[a4paper,margin=5pt]{geometry}          \usepackage{fontenc}     \usepackage{times,multicol,graphicx}     \usepackage[usenames,dvipsnames]{color}     \pagestyle{empty}          \begin{document}      and I get an error if I use `\setsansfont{CMU Sans Serif}` in the preamble.


title: using lists inside multirow

text: I want to use a multirow item list in a column of a table, but it does not work. it says an \item is missing but it already ended before.               \documentclass[a4paper,10pt]{article}          \usepackage[a4paper, top=2cm, bottom=2cm, left=2.5cm, right=1cm]{geometry}     \usepackage{lastpage}     \usepackage[utf8]{inputenc}     \usepackage{array,multirow}     \usepackage{longtable}     \usepackage{tabu}     \usepackage{setspace}     \usepackage[table]{xcolor}     %definir a fonte a utilizar     \usepackage{times}     \renewcommand{\familydefault}{\sfdefault}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}          \vspace{0.5cm}     \noindent     \tabulinesep=1.5ex     \begin{tabu} to \linewidth {|X[m,c]|X[m,c]|X[m,c]}     \cline{0-1}     Autorizado & & \multirow{2}{*}{         \begin{description}             \item[First] The first item             \item[Second] The second item             \item[Third] The third etc \ldots         \end{description}     }\\\cline{0-1}     Não Autorizado & \\\cline{0-1}     \end{tabu}          \end{document}`      **UPDATE** I have done it using a box, but now i have another issue. The table is vertical aligned to middle (m), and in this cell i need it to be aligned to TOP. Not the box, but the multirow. \documentclass[a4paper,10pt]{article}               \usepackage[a4paper, top=2cm, bottom=2cm, left=2.5cm, right=1cm]{geometry}     \usepackage{lastpage}     \usepackage[utf8]{inputenc}     \usepackage{array,multirow}     \usepackage{longtable}     \usepackage{tabu}     \usepackage{setspace}     \usepackage[table]{xcolor}     %definir a fonte a utilizar     \usepackage{times}     \renewcommand{\familydefault}{\sfdefault}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}          \vspace{0.5cm}     \noindent     \tabulinesep=1.5ex     \begin{tabu} to \linewidth {|X[m,c]|X[m,c]|X[m,c]}     \cline{0-1}     Autorizado & & \multirow{2}{*}{     \parbox[t][][t]{4cm}{     \small     \begin{description}     \item[First] The first item     \item[Second] The second item     \item[Third] The third etc \ldots     \end{description}     }     }\\\cline{0-1}     Não Autorizado & \\\cline{0-1}     \end{tabu}          \end{document}`


title: Interaction with multicol and mdframed results in misaligned rows

text: This works fine with TeXLive2011 and _was_ working fine with TeXLive2012 until I recently updated the packages. So with TexLive2011, this produces: ![enter image description here](http://i.stack.imgur.com/37MGn.png) but with an updated TeXLive2012 this yields: ![enter image description here](http://i.stack.imgur.com/zMWls.png) ## Notes:   * Also there seems to be something going on with `\x`. Replace `\Number` in the MWE with `\x` and run with TeXLive2012 (with latest updates). Using `\show\x` shows that it is `undefined`, so not sure why there is a problem with using `\x` as the `\foreach` variable.   * There is an warning from `mdframed` > Package mdframed Warning: You have only a width of 3cm on input line 15 but not sure what it means, or what to do about it. ## Code:               \documentclass{article}     \usepackage{multicol}     \usepackage{pgffor}     \usepackage{parskip}     \usepackage{multicol}     \usepackage{mdframed}     \usepackage{showframe}          \begin{document}\raggedcolumns     \begin{multicols}{6}     \foreach \Number in {1,...,14} {%         \begin{mdframed}%             \mbox{AB-\Number}%         \end{mdframed}     }     \end{multicols}     \end{document}


title: Problem with author-date bibliography

text: For submitting my manuscript to the journal “Communications in Algebra”, I want cite references in the text by author and date only enclosed in parentheses, and At the end of the article, list the references in alphabetical order. Examples: Journal: Hvala, B. Generalized derivations in rings. _Comm. Algebra_ 26:1147–1166. Book: Birkenmeier, G. F., Heatherly, H. E., Lee, E. K. (1995). Completely prime ideals and radicals in Near-rings. In: Fong, Y., et al., ed. _Proceedings of Near-rings and Near-Fields_. Kluwer, pp. 63–73. I use `natbib` with `apalike` style, but I can't do it. Is there any solution?


title: How to achieve the sort and compress behavior in Bibtex4word

text: I needed to work with bibtex and word, and this answer gave me the solution: `Bibtex4word`. However, I ran into a problem. How can I achieve the sort and compress citation style that the natbib and other packages provide. What I mean with this is to have the bibliography sort by citation order, and then grouped citations being sorted by author within the group. For example, if you have a citation               Bla [Foo, Bar], bla [Car, Ar]      it should be formated as               Bla [1,2], bla [3,4]          [1] Bar     [2] Foo     [3] Ar     [4] Car      Instead I obtain               [1] Foo     [2] Bar     [3] Car     [4] Ar      My current format style is `ieeetran/ndusch`


title: Generating PDF without any intermediary files (stdin/stdout)

text: I am programmatically generating PDF's from a template and would like to avoid hitting the hard-drive all the time. Not so much for optimization but because I run parallell threads on all the cores and if the files are not to crash I would have to use some sort of strange naming-system. I would very much like to run pdflatex or xelatex without the use of files. Make it read the tex file from a string (or stdin) and make it print the data for the pdf to stdout. In pdflatex there is an -ipc option that might do what I want, but I can't figure out how to use it. Any help would be very appreciated.


title: Vertically center a float in the remaining part of a page

text: How do I vertically center a table in the remaining part of a page? Specifically, I want to put a large table on a single page but I also want to have a subsection title line at the top. However, using the below code               \documentclass{article}     \usepackage{fontspec}     \setmainfont{TeX Gyre Termes}          \begin{document}     \subsection{Title}     \begin{figure}[p]\centering\begin{tabular}{c}     test\\     \end{tabular}\end{figure}     \end{document}      puts the table vertically centered, but on a new page. Of course, others may want to have several paragraphs followed by a single float centered vertically in the remaining area of the page. So one wonders if there is a way to easily accomplish this?


title: pdfpages and linktodoc

text: I'm trying to link to a specific page in an external document. This has been discussed previously under the topic, How to link to specified page of an outer pdf document?, and the answer suggests including the page into this document, and then link to it internally. I'd rather not include the external pages in my document. I have tried the following from various hints on this site. The following do not work.               \href{doc/mydoc.pdf#page=5}{thedoc}     \href{doc/mydoc.pdf#page.5}{thedoc}     \hyperref{foo.pdf}{page}{2}{some text}     \hyperlink{foo.pdf.2}{some text}      However, `pdfpages` and the `linktodoc` option to `includepdf` does work both internally **and externally**. I get a copy of a specific page of an external document in my local document, and when I click on that page it jumps to the exact page in the external document. This works with `Preview.app` and `Skim.app` on OS X.               \includepdf[pages={2},linktodoc]{foo.pdf}      So this is proof it is possible at least with `Preview.app` and/or `Skim.app` to link to specific external pages. Unfortunately, this link is in the form of an included full page. Is there a way to have this link be some small amount of text of my choosing?


title: fold/unfold sections to expand in PDF

text: Is there a way to fold/unfold certain sections in a pdf. Only when the user clicks on the section or plus sign the items show up. Example: user clicks on the plus sign and the items appear as drop down list. ![](http://i.stack.imgur.com/z35oU.png)


title: From postscript through pgfmath

text: I don't understand the next syntax also I would like (if possible) a traduction of the next function with `pgfmath`                /fct {dup 1 gt {pop 90}{dup 1 neg lt {pop 90 neg}{asin} ifelse} ifelse} def


title: graphics - dynamic image placement

text: This is a follow up to my post here: Graphics - Images off the page in multicolumn environment Using C#, XML, SQL, and LaTeX, I've managed to create a system which retrieves database information and fills LaTeX commands to automatically create nicely typeset catalogs to send to customers. The beauty of this system is that it is completely hands off, no LaTeX code modification is necessary after all of the commands are written. The catalog uses the `multicol` environment since each section within the catalog may have a different number of columns. I found that text-wrapping images in the `multicol` environment works best when using the `picins` package. My previous post uses the `needspace` package to automatically break a column to ensure that the image does not go off the page. The current trouble is that the `needspace` package leaves the catalog with undesirable whitespace which not only diminishes some esthetic appeal, but also accumulates and adds extra pages to the catalog. The following code:               \documentclass{book}     \usepackage{multicol}     \setlength{\columnsep}{0.375 in}     \usepackage{picins}     \usepackage{graphicx}     \usepackage[usenames,dvipsnames]{color}     \usepackage[includeheadfoot, top=.25in, bottom=.25in, left=.5in, right=.5in]{geometry}     \usepackage{needspace}         \usepackage[english]{babel}     \usepackage{blindtext}          \newcommand{\ItemImage}[5]%     {\pichskip{#5 in}\parpic[#2][#3]{\includegraphics[width=#4 in]{#1.png}}}          \newcommand{\ItemDescription}[1]%     {\noindent\color{black}#1\newline}          \begin{document}     \begin{multicols*}{2}     Book Title Number One\\     This is the subtitle of the first book\\     First Name, Last Name\\     \ItemImage{book1}{sr}{r}{1.25}{.125}     \ItemDescription{\blindtext[3] I was often using any of the available “lorem ipsum” generators on the web while testing different things in Latex until I discovered that the Latex distribution provides packages generating blind text, which is definitely more convenient. With just a few lines of code}     000-0-00000-000-0,Hb,\$19.95\\     Book Series\\     6 x 9,100,2012\\     \EndRule          \needspace{20\baselineskip}     Book Title Number Two\\     This is the subtitle of the second book\\     First Name,Last Name\\     \ItemImage{book1}{sr}{r}{1.25}{.125}     \ItemDescription{\blindtext}     000-0-00000-000-0,Hb,\$19.95\\     Book Series\\     10 x 12,500,2012\\     \EndRule          \end{multicols*}     \end{document}      creates something similar to: ![](http://i.stack.imgur.com/6kNc0.jpg) The ideal situation would be (this graphic wasn't made from LaTeX): ![](http://i.stack.imgur.com/SvSp6.jpg) So in the ideal situation, rather than the image being placed before the book description:               *Put Image Here* This would be the description starting in column 1. This line is in     column 1 also.  This line can't fit in column 1 and has moved to column 2      The image would be placed within the book's description:               This would be the description starting in column 1. This line is in column 1.  *Put      Image Here* This line can't fit in column 1 and has moved to column 2      Since the text is automatically placed from the database, there would need to be some way for LaTeX to automatically figure out where to correctly place the image. Floating is what comes to mind, however text wrapping in a `multicol` environment is essential in which picins does the best job and doesn't float. My ultimate question is: Is there a way to calculate the lines remaining in a column, compare that value to the lines an image takes up, and place the image dynamically within a block of text at the point where the text breaks to the next column? A rather round about way to asking a question but I'm very open to suggestions and points in the right direction to how to achieve the ideal situation shown above.


title: UTF-8 error with verbments

text: I'm writing a book using Latex in what I want to write code in Python. My operating system is Linux and my editor is Kile with:               \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{verbments}      But I can not see the characters in Spanish               \begin{pyglist}[language = python, encoding = utf8]         print ('Tomorrow is another day')     \end{pyglist}      I perform the compilation with the command               pdflatex -shell-escape -interaction = nonstopmode      but I get the following error.               *** Error while highlighting:     UnicodeDecodeError: 'utf-8' codec can not decode byte 0xf1 in position 9: invalid continuation byte         (file "/usr/lib/python3.3/site-packages/pygments/lexer.py", line 164, in get_tokens)      I also have observed that verbments generates a file called name.pyg.sty that curiously is codified in ISO-8859-15 instead of UTF-8 as all my other files.


title: Automatic adjustment of cell width

text: My problem is similar to tabular tabularx automatic linebreak (p/m/b doesn't work as expected). However he had some other issues that I don't have. I have a two-column article. In this article I have a table with two columns, using the regular `tabular` environment. The problem is that the second column doesn't automatically do the linebreaks, probably due to the fact that I set the paragraph width to `\textwidth`. I know I can fix this problem by setting something like `0.35\textwidth`, however, this is something that is really bugging me. Isn't there an option/parameter that just tells the last column (far right column), for example, to stop at the margin? I might want to adjust the size of the first column manually, but then, in this case, the second column, should just take the remaining space, up to the margin. Here the MWE:               \documentclass[a4paper]{IEEEtran}          \usepackage[ngerman]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lipsum}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %% Here, main documents begins %%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{document}          \title{FooBar}     \author{Bar Foo,~\IEEEmembership{foobar@google.com}}          % The paper headers     \markboth{FooBar 2013}%     {FooBar2013}          % make the title area     \maketitle          %% -----------------     %% |   Main part   |     %% -----------------          \lipsum          \noindent     \begin{tabular}{ r p{\textwidth} }         & \\         Step 1: & \lipsum[1] \\         Step 2: & \lipsum[2] \\         Step 3: & \lipsum[3] \\         & \\     \end{tabular}          \end{document}


title: Using calc and \year to get the years from a start date automatically in text?

text: I would like to say, "I have played piano for 23 years" -- but this document will have to be changed every year so I remember to make it 23, then 24, then 25. Is there a way to do something like:               I have played piano for \calculate{\year - 1986} years.      Perhaps using the `calc` package and the `\year` command? I haven't been able to figure this out.


title: PGFPlots: Thick line goes outside drawn y-range

text: What is the best way to avoid thick lines in PGFPlots from going outside the drawn y-range? For example, near the maximum in               \documentclass{article}     \usepackage{pgfplots}               \begin{document}          \begin{tikzpicture}     \begin{axis}[axis lines = middle, no markers]     \addplot +[domain=0:3, ultra thick] {5+10*x-5*x^2};     \end{axis}     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/Sh6AM.png) Is there something better than setting y limits by hand? Sometimes (especially when using `restrict y to domain`) I like to let PGFPlots pick sensible limits.


title: geometry options problem

text: I am using geometry package with `\LoadClass[twocolumn]{article}`. But when I use `geometry`, the options for `left,right,top,bottom` are effecting only in `even` pages not in `odd` pages. How can i change globally in `geometry` package. the Class file:               \LoadClass[twocolumn]{article}          \RequirePackage{geometry}     \geometry{     left={15mm},     right={15mm},     top={15mm},     bottom={15mm},     }


title: Graphite features (Chinese Pinyin and low diacritics) on Gentium Plus

text: I'm trying to activate the Graphite features on Gentium Plus (Chinese Pinyin tone marks + low diacritics). This is my minimal example:               \documentclass[utf8,12pt,letterpaper]{article}     \usepackage{fontspec}     \begin{document}     \fontspec[Renderer=Graphite,RawFeature={1057=1},RawFeature={1054=1}]{Gentium Plus}          mā má mǎ mà          \end{document}      However, the features are not activated when I compile with XeLaTeX. On the contrary, I get this warning:               *************************************************     * fontspec warning: "only-luatex-feature"     *      * Ignored LuaTeX only feature: 'Renderer=Full/Basic'.     *************************************************      Although I didn't chose Full or Basic. I have taken this into account: Using Graphite fonts on XeLaTeX


title: What is glue stretching?

text: I had a question about dynamic vspaces (Dynamic vspace depending on text height) and there was a hint I should use a stretchable glue.   Searching with Google didn't give me a helpful answer. I would be glad, if someone can explain it and give me a simple example to understand how it works.


title: Mel scale conversion in pgfmath, decimal point problem

text: I am trying to use `pgfmath` to convert frequencies in hertz to the mel scale. I'm trying to implement a formula for which I have a Java source and which I have previously implemented with success in XSLT. My attempt with `pgfmath` yields the results which I would expect up to 1000, afterwards the decimal place is three places to the right of what I would expect. A small latex file demonstrating the problem follows. It includes Java and XSLT versions of the formula. I am new to `pgfmath` (but regularly use `pgf`) and my numerical math skills have languished for many years, so I am rather clueless at this point. Example:               \documentclass{article}     \usepackage{pgfmath}     \usepackage{pgffor}     % java code borrowed from sphinx4 MelFrequencyFilterBank.java:      % (2595.0 * (Math.log(1.0 + inputFreq / 700.0) / Math.log(10.0)))     % Implemented in XSLT as follows:     % <xsl:function name="local:hz2mel">     %     <xsl:param name="inputFreq" as="xs:double"/>     %     <xsl:value-of select="2595.0 * (math:log(1.0 + $inputFreq div 700.0)) div math:log(10.0)"/>     % </xsl:function>     % Attempt to implement in pgfmath     \newcommand{\hztomel}[1]{%       \pgfmathparse{2595.0*ln(1+#1/700)/ln(10)}%       \pgfmathresult%     }     \begin{document}     \noindent     \foreach \x in {0, 200, 400, 1000, 1001, 2000, 5000,10000}              {\x{} $\rightarrow$ \hztomel{\x}\\}     \end{document}      * * *


title: Forcing math mode to be on the same line

text: I would like to have math mode expressions in dollar signs always to stay on the same line, which is what happens to a sequence of characters with no spaces while not in math mode. Is there a way to avoid having to do this manually by adding line breaks every time (which is terrible style, and gets very messy if one has to go back and change things, altering everithing that comes after)?


title: Encoding problems (switching between Japanese and English encoding)

text: I seem to have messed up the encoding of my tex document in TexShop and I wonder if anyone can explain to me what's going on? I had a short document which was fine, until I needed to add some Japanese, so I added               %!TEX encoding = UTF-8 Unicode      at the top line and then               \documentclass[a4paper,12pt]{article}          % Packages     \usepackage{CJKutf8}          \begin{document}     \begin{CJK}{UTF8}{goth} % for gothic (sans serif) font     \CJKnormal          % Cite English reference     \cite{UK2013}          % Cite Japanese reference     \cite{Japan2012}          \bibliographystyle{custom}     \bibliography{references}          \end{CJK}     \end{document}      After doing this, all my backslashes changed to yen signs, and any backslash I typed came up in the editing window as a yen sign. Now when I compile it has an error               "Missing \begin{document}"      and shows an error               DOT documentclass[a4paper,12pt]{article}      where DOT is literally a dot. So it's clear that the backslashes have all been lost. Can anyone explain to me what's going on with the encoding, and how I can fix it? I am aware of XeTeX, but I heard that by adding lines from the package CJKutf8 as I have done above, it is possible to avoid having to install another huge Latex implementation just for the use of Japanese characters.


title: Make table of contents appear on a PDF index

text: I want the entries for my table of contents at the beginning of my document to appear in the PDF index, for a PDF generated with `pdflatex`. Currently only my `\chapter` entries appear there, and adding `\chapter` entries for the table of contents is not an option, first of all since it is not an actual chapter and shouldn't be enumerated as such, and also because adding `\chapter` entries adds extra empty pages to my document. EDIT: For my bibliography I managed to add it using               \usepackage[nottoc,numbib]{tocbibind}      But can't be sure if there's something similar for the table of contents


title: Centering a text in longtable

text: I am having some difficulty with centering a text in a table. If you happen to have some spare time, please kindly enlighten me on the following problem. Referring to the picture below, you could see that the word "Graph" is left aligned instead of center. How to make it centered? Could you please provide advice or guidance on the issue?               \documentclass{article}     \usepackage[english]{babel}     \usepackage{tikz}     \usepackage{multirow}     \usepackage{longtable}     \usepackage{booktabs}     \usepackage{array}          \newcommand{\tesplot}{%     \begin{tikzpicture}     [scale=.4,auto=center]     \node (n1) at (10.6,4.9) [draw, circle,fill=green!20] {1};     \node (n2) at (4,0.8) [draw, circle,fill=blue!20] {2};     \node (n3) at (3.8,11.4) [draw, circle,fill=green!20] {3};     \node (n4) at (0.1,6.4) [draw, circle,fill=green!20] {4};     \node (n5) at (3.6,3.4) [draw, circle,fill=blue!20] {5};     \node (n6) at (7.4,2.3) [draw, circle,fill=blue!20] {6};     \node (n7) at (9,10.4) [draw, circle,fill=green!20] {7};     \node (n8) at (18,10.8) [draw, circle,fill=green!20] {8};          \foreach \from/\to in {n6/n2,n2/n5,n5/n6}     \draw[blue] (\from) -- (\to);     \foreach \from/\to in {n1/n8,n8/n7,n7/n1,n3/n7,n4/n3}     \draw[green] (\from) -- (\to);     \foreach \from/\to in {n6/n1,n5/n4,n2/n4,n1/n5}     \draw[red] (\from) -- (\to);          \end{tikzpicture}     }     \begin{document}          \begin{longtable}{ l  l  l  l >{\centering\arraybackslash}m{7cm} }     \toprule     \multicolumn{5}{ c }{Convergence} \\     \midrule     Time & \multicolumn{2}{ c }{Information} & Graph & Description \\      \cmidrule(r){1-1}\cmidrule(lr){2-3}\cmidrule(lr){4-4}\cmidrule(l){5-5}     & Vertice & 8 & & \\[1cm]      1 & ${P(1)}$ & 0.5 &      \raisebox{-2.3cm}[50pt][50pt]{%     \tesplot} &  \raisebox{-0.1cm}[0pt][0pt]{%     \begin{minipage}[c]{2.8in}     Hello World akdjfasljdfkjasj dfjsadkflkjksad flkaskjdfsadlflkj safdalkjsfd sljdfkjasj         dfjsa sljdfkjasj dfjsadkflkjksad flkaskjd fsadlflkj safdalkjsfd sljdfkjasj dfjsadkflkjksad flkaskjdfsadl flkj safdalkjsfd dkflkjksad flkaskjdfsadlflkj safdalkjsfd     \end{minipage} } {%     } \\[1cm]      & Chance & 0.5 & & \\[1cm]          \bottomrule     \end{longtable}          \end{document}      ![1](http://s23.postimg.org/4lm2845h7/qpic.png)


title: How to left align a set of equations in LyX

text: How can I left align an AMS `flalign` block in LyX? The answers in Use flalign or alignat or align or similar environment to align to the left say that to left align a set of equations one should use               The formula is     \begin{flalign*}     a &= b+c &\\       &= 1+1 &\\       &= 2  &     \end{flalign*}      and that it is important to have an `&` as the last character of the line. The problem is that LyX will produce the following LaTeX code:               \begin{flalign*}     a & =b+c\\      & =1+1     \end{flalign*}      I see two problems here:   1. there is no `&` at the end of the lines,   2. there is a space after the first `&`. How can one make LyX create code that will display as a left-aligned block of equations?


title: How can I draw a table where the upper left corner is missing? (Pic)

text: Is it possible to draw a table like the one in the attached picture? I've read documentation on the `tabular` environment but nothing really describes this well. The shading would be nice but the crucial part is the layout (5 columns, 2x2 merged cells on the top row and the top left 2 cells have no shading or border) ![enter image description here](http://i.stack.imgur.com/DWZ5S.png)


title: How to get the section label from a label inside an enumerate-list?

text: When I define a label inside an enumerate-list I get a reference to the item number. Is it possible to get a reference to the section? Example:               \documentclass[english]{scrartcl}      \usepackage{babel}      \usepackage{blindtext}           \newcommand\secref[1]{[section of label '#1']}%<-- I ask for this function.     \begin{document}     %Should be: The 2nd item point on page 3 is in section 2.3.1     The \ref{mylabel}nd item point on page \pageref{mylabel} is in section \secref{mylabel}          %Should be: The 2nd item point on page 3 is in section 2.3.1     The \ref{mylabel}nd item point on page \pageref{mylabel} is in section \ref{sec:mylabel}          \blinddocument%create some (sub)sections          \label{sec:mylabel}     \begin{enumerate}     \item point 1     \item \label{mylabel} here is a label     \end{enumerate}          \end{document}      Remark I: I don't want to replace `\ref` to show always the section reference. I want to have the choice to get the item reference or the section reference. Remark II: The 2nd sentence in my example shows the result I want. But I want to avoid the definition of the _help-label_ `sec:mylabel`.


title: htbp and longtable

text: I am applying a `longtable` environment. I would like to use something like `[htbp]` in order to put the table in the next page. Every time I do it gives me an error. Now I am solving the problem with a simple `\pagebreak`. Do you know a better solutions to this problem?


title: Extra vertical space after \hline causes a gap in the right border of an array

text: I wanted to put a bit of space after an `\hline` in an `array`; the main suggestion floating round the Internet seems to be to use               \hline \\ [-1.5ex]      Unfortunately, this causes a gap in the line on the RHS of the `array`. A minimal example is:               \documentclass{article}     \begin{document}     $\begin{array}{|l|l|}%     \hline     & TEXT\\     \hline \\[-1.5ex]     &TEXT     \\\hline     \end{array}$     \end{document}      ![enter image description here](http://i.stack.imgur.com/LKZ0o.png) Any help would be much appreciated!


title: Changing colors of included cmyk jpg

text: I am trying to convert a pdf containing grayscale pictures and black text into shades of a single color in cmyk color space (for printing). I was thus very happy to learn, from a side remark in one of Heiko Oberdiek's answers about the key `decodearray` of `\includegraphics`, which lets us specify a linear transformation on each channel of the given color space. This key places the appropriate `/Decode` array in the pdf file, and colors are converted when displaying or printing the pdf file. The approach works fine for grayscale or rgb images, but fails for cmyk images, and here is why. There are two kinds of cmyk color spaces (or of cmyk jpg images?): one for which white is all zeros and one for which it is all ones. To invert colors, pdfTeX uses a `/Decode` array which maps the interval [0,1] to [1,0] in each channel. This second `/Decode` array overrides ours. See a recent answer of mine for more details. The question is to know how I can remove the second `/Decode` array, or otherwise include a cmyk image with altered colors. My current solution is to post-process the pdf, replacing the second `/Decode` array by spaces. Some code: first build a cmyk image               convert `kpsewhich example-image.jpg` -colorspace cmyk /tmp/example-image-cmyk.jpg      then include it               \documentclass{article}     \usepackage{graphicx}     \begin{document}     \includegraphics[decodearray={1 1 0 0 1 0 0 1}]{example-image-cmyk.jpg}     \end{document}      and run `pdflatex` on this file. Afterwards, look at the pdf file and find the `/Decode` key twice in the same dictionary, and replace the second one by `/Xxxxxx` (or whatever key, with the same length). The pdf now has new colors. EDIT: From an email discussion of pdfTeX developpers 6 years ago, it seems that providing the `colorspace` keyword to the primitive underlying `\includegraphics` may help.


title: How to prevent figures from floating 'into' listings

text: I have a problem with floats and listings. Sometimes it happens that a listing is split over two pages and when a figure is near the listing it happens that the listing starts on the first page, on the next page the figure is on top of the second page and below the figure the listing continues. Is it possible to let the remainder of the listing be on the top of the second page and the figure start below the listing or on top of the third page?


title: Line breaking and floating

text: I have a matrix and I want to show some lines of text floating right to the matrix. The problem is that the following code shows two lines of text without executing `\\` break-line.               \[ M = \left( \begin{array}{cccc}     a & b & c & d \\     1 & 2 & 3 & 4\\     a & b & c & d\\     1 & 2 & 3 & 4 \end{array} \right)\ Something  \\ Something     ]       How can I fix it?


title: I want to draw block diagrams,what's wrong?

text: I want to draw the circuits below, however, the code doesn't work. would someone help me? ![enter image description here](http://i.stack.imgur.com/Gwejh.png)               \documentclass{article}          \usepackage{tikz}          \usetikzlibrary{circuits}     \usepackage{verbatim}               \begin{document}          \begin{tikzpicture}         \sbEntree{E}         \sbComp{a}{E}         \sbBloc{b}{$H_1$}{a}                 \sbRelier[$E_1$]{E}{a}         \sbBlocL{c}{$H_2$}{b}                 \sbRelier[$\epsilon$]{a}{b}         \sbComph{d}{c}                 \sbRelier[u]{c}{d}         \sbBlocL{e}{$H_3$}{d}         \sbBlocL{f}{$H_4$}{e}         \sbSortie[5]{S1}{f}                 \sbRelier{f}{S1}                 \sbNomLien[0.8]{S1}{$S_1$}         \sbDecaleNoeudy[-4]{f}{u}         \sbDecaleNoeudy{e}{v}         \sbBlocr{r1}{$R_1$}{u}         \sbBlocr{r2}{$R_2$}{v}         \sbBlocrL{r3}{$R_3$}{r2}         \sbRelieryx{f-S1}{r1}         \sbRelierxy[n1]{r1}{d}         \sbRelieryx{e-f}{r2}         \sbRelierxy[n2]{r3}{a}     \end{tikzpicture}          \end{document}


title: Multiple transitions between states with TiKZ

text: I'm trying to create two transitions between states while using the TiKZ library for automata drawing. Currently, I have this example code :               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{arrows,automata}     \begin{document}     \begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=4cm]         \node[state] (A)                {A};         \node[state] (B) [right of = A] {B};         \path[->] (A) edge [bend left]  node {x = 0} (B)                   (B) edge [bend right] node {x = 1} (A);     \end{tikzpicture}     \end{document}      Which yields the following result : ![My ugly FSM](http://i.stack.imgur.com/qtfLe.png) I'd like to have two arrows between the states instead : one with `x = 0`, and the second one with `x = 1`. How can I do that with TiKZ?


title: How to eliminate numbers on left side of LoF

text: I would like to get rid of the numbers on the left side of my LoF, like in this example. I tried `\def\figureformat{}` but that did not do anything. However, my figures are really full-page pictures inserted without a figure environment.               \documentclass[12pt, a4paper, twoside]{article}     \usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{caption}     \begin{document}     \tableofcontents\listoffigures      \newpage     \section{part 1}     I have some text here.  Then pics.     \newpage     \vbox{     \centering     \includegraphics[angle=90, scale=0.65]{hamlet4.pdf}     \captionof{figure}[Variation in \emph{Hamlet}]{cool pic}     }     \vbox{     \clearpage     \includegraphics[angle=270, scale=0.65]{kinglear4.pdf}     \captionof{figure}[Variation in \emph{King Lear}]{cool pic 2}     }     \newpage     some more text here     \end{document}


title: How to allow curly braces in command option

text: I need to store an URL parameter like `&path=weigth:5|color:orange|enc:okydHa}peAXOHi@jANv@A@kJJmFAiDJuAHmDXcBb@cC`@gC^_DV}CJaCF{APaBVkBdAyEf@qC`@{B\aDSwB` with later reencoding to `utf8` and passing to a lua script.               \documentclass{article}     \usepackage[latin1]{inputenc}     \usepackage{xkeyval}     \makeatletter     \define@key{testcmd}{arg}[]%     {%       \gdef\testcmdarg{\detokenize{#1}}%     }%     \newcommand*\testcmd[1][]{\setkeys{testcmd}{#1}}%     \makeatother     \begin{document}     \testcmd[arg={&path=weight:5|color:orange|enc:}]     %\testcmd[arg=&path=weight:5|color:orange|enc:okydHa}peAXOHi@jANv@A@kJJmFAiDJuAHmDXcBb@cC`@gC^_DV}CJaCF{APaBVkBdAyEf@qC`@{B\aDSwB]     Test: \testcmdarg     % in fact, the option is reencoded to utf8 and passed to a lua script! no output!     \end{document}      Most of the problems are solved with `\detokenize`, but the curly braces are still a problem. I guess it has something to do with the catcodes. So how can i change the catcodes and limit the change to the setting of the option? Or is there another way to store the option as "text"?


title: How can I distribute a non-CTAN font with my source files?

text: I want to distribute the LaTeX source my work to various people, who use different platforms and I want to save them from having to install the font I use manually. I am using this font: http://www.math.unl.edu/~shartke2/computer/latex/Millennial-20110819.tar.bz2 Is there a way I can point `pdflatex` from the LaTeX source to use the font package (Millenial) which is located in the same directory as the LaTeX source file?


title: Modify \listofschemes output to match memoir class

text: I am using the `memoir` class with the `chemstyle` package. I just observed that the output from my `\listofschemes` command has a different indentation and format than my `\listoffigures` output. I tried to look into the definition of chemstyle and redefining the `\listofschemes` but I can't quite figure out how to modify the output to match the standard `\listoffigures` output. Here is the MWE:               \documentclass[oneside,openany,11pt]{memoir}     \usepackage[demo]{graphicx}     \usepackage{chemstyle}          \begin{document}     \frontmatter     \addcontentsline{toc}{chapter}{Table of Contents}\tableofcontents*\clearpage     \listoffigures\addcontentsline{toc}{chapter}{List of Schemes}\listofschemes     \mainmatter     \chapter{Chapter one}\section{Sec one}     \begin{figure}\caption{Test}\includegraphics{blank}\end{figure}     \begin{scheme}\caption{Test2}\includegraphics{blank}\end{scheme}     \section{sec two}     \begin{figure}\caption{Test3}\includegraphics{blank}\end{figure}     \begin{scheme}\caption{Test4}\includegraphics{blank}\end{scheme}     \begin{figure}\caption{Test5}\includegraphics{blank}\end{figure}     \chapter{Chapter 2}\section{chap 2 sec 1}     \begin{scheme}\caption{Test6}\includegraphics{blank}\end{scheme}     \begin{figure}\caption{Test7}\includegraphics{blank}\end{figure}     \begin{scheme}\caption{Test8}\includegraphics{blank}\end{scheme}     \section{chap 2 sec 2}     \begin{figure}\caption{Test9}\includegraphics{blank}\end{figure}     \begin{scheme}\caption{Test10}\includegraphics{blank}\end{scheme}     \end{document}      Looking at the `chemscheme.sty` file it even looks like the indentation should be zero, so I'm a little puzzled...               \newlistentry[chapter]{scheme}{los}{0}%     \cftsetindents{scheme}{0em}{2.3em}%      I'm using a whole list of other packages, but this recreates the problem. Just in case it plays into the solution, I also use `floatrow`, `flafter` as well.


title: Using \ifstrequal in a fontspec macro

text: Here is my Minimal Failing Example:               \documentclass{article}     \usepackage{fontspec,etoolbox}     \setmainfont{TeX Gyre Schola}          \begin{document}          \newcommand\Stretch[1]{       \ifstrequal{#1}{narrow}{0.6}{}       \ifstrequal{#1}{wide}{1.5}{}     }          Normal. {\addfontfeature{FakeStretch=\Stretch{narrow}} Narrow.} Normal.     Normal. {\addfontfeature{FakeStretch=\Stretch{wide}} Wide.} Normal.          \end{document}      (Xe)LaTeX fails with the message `Missing \endcsname inserted` because of the `\ifstrequal` macro. Can you explain me why? And how can I modify the `\Stretch` macro so that it works?


title: How can I use \belowcaptionskip with listing?

text: \documentclass{mwrep}     \usepackage{minted}     \usepackage{lipsum}          % question regarding this code     \setlength{\belowcaptionskip}{-10pt}     % end          \begin{document}     \lipsum[1]     \begin{listing}[h]     \begin{verbatim}     1     2     3     4     \end{verbatim}     \caption{test}     \label{lst}     \end{listing}     \lipsum[2]     \begin{figure}[h]     \begin{verbatim}     1     2     3     4     \end{verbatim}     \caption{test}     \label{ver}     \end{figure}     \lipsum[3]     \end{document}      Why does `\listing` ignore change of `\belowcaptionskip`? What can I change to make `listing` affected by it as in case of `figure`?   How can I make caption of `listing` be identical with caption of `figure` in every manner (like fontsize, which on my example is smaller in `figure`).


title: Using pdfpages with mixed landscape / portrait pdfs

text: I am using `pdfpages` to include PDFs in my LaTeX document. Some of these `pdfs` have both `landscape` and `portrait` pages, and I won't necessarily know in advance where these occur. Is there a way to get `pdfpages` to handle this mixed content? At the moment, I am just including everything as portrait (`[landscape=false]`), which does produce a workable document but with the landscape pages rotated and scaled down. Alternatively, is there a different solution than pdfpages? MWE where `one.pdf` is a (hypothetical) PDF with mixed landscape and portrait pages:               \documentclass[12pt,english]{article}     \usepackage{pdfpages}          \begin{document}          This is the text in the master file.          \includepdf[pages=-]{one}          \end{document}


title: Generate l3keys meta key from subkey

text: I’ve created a simple package with options settable via `l3keys2e`. I was able to figure out how to make the syntax               \usepackage[format = international]{phone}      work, but I’d like to make the syntax               \usepackage[international]{phone}      be a synonym. The method I’m using in the code below works, but is very repetitive, especially when I’ve got more formatting options. Is there a simpler way? Here’s the code:               \RequirePackage{expl3, l3keys2e, xparse}     \ProvidesExplPackage         {phone}{2013/06/19}{0.1}{Format phone numbers}          \cs_new_nopar:Npn \phone_international_fmt:NNN  #1#2#3       { +1 - #1 - #2 - #3 }          \cs_new_nopar:Npn \phone_parendash_fmt:NNN  #1#2#3       { (#1) \nobreakspace #2 - #3 }          \keys_define:nn { phone }       {         format .choice_code:n =           {             \cs_new_eq:Nc \phone_fmt:NNN                { phone_ \tl_use:N \l_keys_choice_tl _fmt:NNN }           },         format .generate_choices:n =           {             international,             parendash,           },     % These next lines will become repetitive if I have many more formatting options         international .meta:n = { format = international },         parendash     .meta:n = { format = parendash     },       }          \ProcessKeysOptions { phone }          \NewDocumentCommand \phone       { >{ \SplitArgument {2} {-} } m }       { \phone_fmt:NNN #1 }          \endinput      A minimal example using this package looks like this:               \documentclass{article}          % \usepackage[parendash]{phone}     \usepackage[format = parendash]{phone}          \begin{document}          \phone{212-555-1212}          \end{document}      This yields the desired result > (212) 555-1212


title: Chemnum does not work since last l3package udpate

text: I am using `chemnum` package and since last updates of `l3packages`, `l3kernel` and `l3experimental` when I compile my code there are 14 errors. The first one is: > LaTeX error: "kernel/command-not-defined" > > Control sequence \chemnum_aux_file undefined Despite this error the code is working and it gives me a good output, but this error should mean something:               \documentclass[a4paper, 10pt]{report} %environnement du document     \usepackage[latin1]{inputenc}      \usepackage[T1]{fontenc} %prise en charge des caractères spéciaux     \usepackage[frenchb]{babel} %langue     \usepackage{mathrsfs}     \usepackage{graphicx} %prise en charge des graphiques eps     \usepackage{geometry}     \usepackage{epstopdf}     \geometry{margin=55pt} %marges     \usepackage{indentfirst} %indentation après le titre de section     \usepackage[bottom]{footmisc} %bas de page en toute fin de page     \usepackage{csquotes} %pour la biblio     \usepackage{lmodern}     \usepackage[intoc]{nomencl}     \usepackage[backend=biber,style=chem-acs,subentry,maxnames=20]{biblatex} %style acs     \bibliography{library}       \usepackage{caption}     \usepackage{chemnum,chemstyle,chemscheme}%pour les schémas de chimie     %\usepackage[runs=2]{auto-pst-pdf}          \usepackage[version=3]{mhchem}  %prise en charge de l'écriture chimique                         \begin{document}          \begin{scheme}[H] %le H permet de fixer l'image ici         \centering             \cmpdref{CM52}             \cmpdref{CM53}             \cmpdref{CM54}             \cmpdref{CM55}             \includegraphics[scale=0.80]{schema/13.eps}             \caption{}             \label{13} %permet de faire reference dans le texte     \end{scheme}          \end{document}      Is there a way to fix it?


title: drawing tree using tikz, child overlap

text: I am trying to draw a tree but unfortunately i have some childs overlap each other,I increased the **sibling distance** , even i have used the option **scale** but i have the same problem. here is my code :               \documentclass[openright,a4paper,11pt,french]{report}          \usepackage{tikz}     \usetikzlibrary{arrows,positioning,automata,shadows,fit,shapes}          \begin{document}          \begin{tikzpicture} [scale=.6]     \tikzstyle{level 1}=[sibling distance=60mm]      \tikzstyle{level 2}=[sibling distance=30mm]      \tikzstyle{level 3}=[sibling distance=20mm]            \node{country}          child{node{name}child{node{ France }}}        child{ node{city}child{node{ Paris }}}       child{ node{region}child{node{name}child{node{ Nord-Pas De Calais }}}child{node{population}child{node{ 3996 }}}       child{node{city}child{node{ Lille }}}}child{node{region}child{node{name}child{node{ Valle du Rhone }}}child{node{city}child{node{ Lyon }}}child{node{city}child{node{ Valence }}}};       \end{tikzpicture}       \end{document}      and the result is ![enter image description here](http://i.stack.imgur.com/nwzpK.png)


title: How can I create a matrix normal form?

text: Is it possible to create a matrix like the following draft with LaTeX? ![enter image description here](http://i.stack.imgur.com/01RFj.png) I have found this Tikzample, but I don't know how to get the dots on the diagonal. edit: This is how far I got: ![enter image description here](http://i.stack.imgur.com/bGyLc.png)               $$     \begin{pmatrix}     1 &  &   &    &  &      &              &                & &              \\       &  &   &    &  &      &              &                & &              \\       &  & 1 &    &  &      &              &                & &              \\       &  &   & -1 &  &      &              &                & &              \\       &  &   &    &  &      &              &                & &              \\       &  &   &    &  & - 1  &              &                & &              \\       &  &   &    &  &      & cos \omega_1 & -sin \omega_1  & &              \\       &  &   &    &  &      & sin \omega_1 &  cos \omega_1  & &              \\       &  &   &    &  &      &              &                & &              \\       &  &   &    &  &      &              &                & & cos \omega_2 \\       &  &   &    &  &      &              &                & & sin \omega_2 \\     \end{pmatrix}     $$        The lime part is what I would like to have, but wasn't able to do with LaTeX.


title: How can I execute some code at each occurence of an EOL character in a listing?

text: My question is very similar to Peter Grill's, How to detect a tab character when processing a literate in lstlistings? I'm trying to count the number of `^^M` characters encountered in my listing _behind the scenes_ , using `literate` as follows:               literate={\^^M}{{\ProcessNewline}}1,      where the whole purpose of `\ProcessNewline` is to increment a counter **and** insert a `^^M` character (in order to effect a line break in the listing as if I wasn't messing around with `literate` at all). Incrementing the counter is not a problem, but my attempts at inserting a `^^M` character back have been infructuous. What I think was my best shot is shown in the code below, but I get a `TeX capacity exceeded` error. What am I doing wrong and what should I do?               \documentclass{article}          \usepackage{listings}          \newcounter{foo}     \setcounter{foo}{0}          % the following four lines are adapted from Martin Scharrer's lstautogobble package     \begingroup     \catcode `\^^M=\active%     \gdef\activenl{^^M}% Active CR (ASCII 13) ↙character which is used as line break     \endgroup          \newcommand*{\ProcessNewline}{%         \stepcounter{foo}%         % \activenl% You'll get an error if you uncomment his line     }%          \lstset{%         literate={\^^M}{{\ProcessNewline}}1,     }          \begin{document}      \begin{lstlisting}     one     two     three        \end{lstlisting}     \end{document}