title: page number in a diamond box

text: I have the following code I need to put the page number at the top of the page resulted in a diamond box. I would be grateful for any help or if you can indicate to me the code to generate it. ![enter image description here](http://i.stack.imgur.com/eUgVn.jpg) There is something I forgot, the page number should be on the left for the even pages and on the right for the odd pages.


title: Using LaTeX in a Web page created in HTML

text: I am creating a web page related Mathematics. So, while scripting if I use Latex like $$\frac{x^2+y}{\sqrt{x^4-x^2+47}}$$, the output I see is same. Can anyone help me out from this problem? By the by I don't want to embed the equation.


title: \alph without counters

text: When I iterate numbers with TikZ `\foreach`, they are stored in a macro. Now, when I need the letter corresponding to this macro, I can only convert it by saving it to a counter and then receiving it again.               \foreach \n in {1,...,10} {       \setcounter{number}{\n}       \edef\letter{\alph{number}}     }      Directly issuing               \alph{\n}      does not work. I think it would be more efficient to avoid the counter. Is it possible convert directly?


title: Biblatex referencing using IEEE style with Annotations

text: I am compiling the references for a technical report, using biblatex to manage my citations and I require a annotated bibliography style. When I compiled the first draft of this report I used bibtex with the `plain- annote` bibliography style. I was not happy with this implementation because of two reasons; the IEEE citation style was not well represented which is critical for my needs, and the order in which the citations occurred was not appropriate, and sorting these is not a simple task with bibtex. I currently use biblatex with all of my assignments with `style=ieee`, because it produces an output which follows the IEEE citation style which is required, and it is very easy to work with. Using biblatex the only thing I require is the addition of the `annote` field with the IEEE style. I have read through the biblatex documentation and the `reading` style is the only one I have found that will display my annotations, but its general style is not desired. Am I missing something as far as adding the `annote` field to an IEEE styled reference with biblatex?


title: Can you define what a reference should say in clear text?

text: When you create a reference list (with the command `\bibliography{x}`), using the `apacite` package, is there any way to hijack the list, so of speak, and define what individual entries should say in clear text? For example, if I want to refer to a painting, and I'm using Mendeley as my database for papers, it might get a little tricky to get everything to show up right. Here, instead of trying to hack the style and BibTeX files, it would be much more convenient to just spell out in clear text exactly what the reference should say.


title: Position an automata below another, both centered

text: I want to draw two automata in a `tikz` picture. The second automaton should be below the first, and both should be centered horizontally.               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{automata, positioning}          \begin{document}          \begin{tikzpicture}[node distance=15mm, auto]       % first automaton       \node[state,initial]   (sA)               {$A$};       \node[state,accepting] (sB) [right of=sA] {$B$};       \path[->] (sA) edge[loop below] node {$0$} ()                 (sA) edge[bend left]  node {$1$} (sB)                 (sB) edge[bend left]  node {$0$} (sA);            % second automaton       \node[state,initial]   (s0) [below=15mm of sA] {$s_0$};       \node[state]           (s1) [right of=s0]      {$s_1$};       \node[state,accepting] (s2) [right of=s1]      {$s_2$};       \path[->] (s0) edge node {$a$} (s1)                 (s1) edge node {$b$} (s2);     \end{tikzpicture}          \end{document}      ![two automata in the same tikz picture](http://i.stack.imgur.com/7EkUX.png) How is the best way of getting the automata centered? **EDIT** : The `standalone` class is used here only for illustration purposes. I really intend to use the `beamer` class.


title: Vertical alignment in table environment and other issues

text: I'm having some difficulties with the table below. I don't understand why the text in the column 4 is not vertically centered. Also, the title of this column is not horizontally aligned with the titles of the 2nd and 3rd columns. Finally, the vertical line between the first and the second column is not continuous.               \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}          \begin{table}     \centering     \footnotesize     \begin{tabular}{C{0.70in}| C{1.60in} C{1.60in} C{1.60in}}                       & \textbf{Column 2}    & \textbf{Column 3}   & \textbf{Column 4}   \\[1ex] \toprule      \textbf{Row 2}   & text text text text  & text text text text & text text text text \\[4ex] \midrule      \textbf{Row 3}   & text text text text  & text text text text & text text text text \\[4ex] \bottomrule      \end{tabular}      \end{table}      Many thanks in advance for your help :) Beth.


title: Vertical text in table with no vertical lines

text: I want to modify this table in this way: ![enter image description here](http://i.stack.imgur.com/Eb8El.png) Here is my MWE, in which I tried to achieve it with no success.               \documentclass{article}     \usepackage{array}    % \extrarowheight macro     \usepackage{graphicx} % \rotatebox macro     \usepackage{multirow} % \multirow macro     \usepackage{booktabs} % for \toprule, \midrule, \bottomrule     \begin{document}               %Before          \noindent\makebox[\textwidth][c]{     \begin{minipage}[c]{\textwidth}     \centering     \begin{tabular}{@{}ccccc@{}}     \toprule     Expert & \multicolumn{4}{c@{}}{Prediction}\\     \cmidrule(l){2-5}     & Blah & BlahBlahBlahBlah & BlahBlahBlah & BlahBlahBlah \\     \midrule     Blah & $10$ & $10$ & $10$ & $10$\\      BlahBlahBlahBlah & $10$ & $10$ & $10$ & $10$\\      BlahBlahBlah & $10$ & $10$ & $10$ & $10$\\      BlahBlahBlah & $10$ & $10$ & $10$ & $10$\\      \bottomrule     \end{tabular}     \end{minipage}     }          \vspace{5cm}          %After     \noindent\makebox[\textwidth][c]{     \begin{minipage}[c]{\textwidth}     \centering     \begin{tabular}{c|@{}ccccc@{}}     \toprule     \parbox[t]{2mm}{\multirow{4}{*}{\rotatebox[origin=c]{90}{Expert}}} &  & \multicolumn{4}{c@{}}{Prediction}\\     \cmidrule(l){2-5}     & Blah & BlahBlahBlahBlah & BlahBlahBlah & BlahBlahBlah \\     \midrule     Blah & $10$ & $10$ & $10$ & $10$\\      BlahBlahBlahBlah & $10$ & $10$ & $10$ & $10$\\      BlahBlahBlah & $10$ & $10$ & $10$ & $10$\\      BlahBlahBlah & $10$ & $10$ & $10$ & $10$\\      \bottomrule     \end{tabular}     \end{minipage}     }     \end{document}      Someone knows how to get it? Thanks!


title: Modifying a letter with scrlttr2

text: I'm writing my first letter with LaTeX, and I need some help:   1. I need to put the address of the sender on the upper left side of the page.    2. Put my name in the lower right part of the page.    3. I would like to have the date immediately under the receiver name, separated with some space. Can someone help me?                \documentclass[a4paper,12pt]{scrlttr2}     \usepackage[italian]{babel}     \usepackage[latin1]{inputenc}     \makeatletter     \@setplength{toaddrvpos}{40mm}     \@setplength{toaddrhpos}{110mm}     \makeatother          \begin{document}     \begin{letter}{Name \\ Of \\ Receiver}          \opening{Dear...,}      Text....     \closing{Best regards,}     \end{letter}     \end{document}


title: Is it possibile to report the baseline of a dvipng converted image without using preview-latex?

text: I'm compiling .tex with pdftex and to align some PNG images created with dvipng (I love it's speed), I need to use the `--depth` value from this utility. But as I can read, correct values are output only when using preview- latex. I also tried the standalone class, but the pages are all joined and I need them splitted as dvipng output, if the previw package is off. Is there another possibility?


title: Binary Red Black Trees, adding a pointer?

text: I want to illustrate the algorithm for rotation on red-black trees. How can I draw an external (and temporarly) pointer on the leaf '5'. The arrow should must come from above-left with a label ('y' for example). My (uncomplete) example               \documentclass{minimal}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{arrows,automata}     \usetikzlibrary{positioning}          \tikzstyle{arn_n} = [circle, white, font=\bfseries, draw=black, fill=black, align=center, inner sep=0pt,text width=1.5em, text centered]% black node     \tikzstyle{arn_r} = [circle, red, draw=red, align=center, inner sep=0pt,text width=1.5em, text centered, very thick]% red node     \tikzstyle{arn_x} = [rectangle, draw=black, align=center, inner sep=0pt,minimum width=0.5em, minimum height=0.5em]% NIL 'node'          \begin{document}          \begin{tikzpicture}[->,>=stealth',level/.style={sibling distance = 5cm/#1, level distance = 1.5cm}]      \node [arn_n] {33}         child{ node [arn_r] {15}              child{ node [arn_n] {10}                  child{ node [arn_r] {5}                         edge from parent node[above left] {$x$}} % name of pointer                 child{ node [arn_x] {}}             }             child{ node [arn_n] {20}                 child{ node [arn_r] {18}}                 child{ node [arn_x] {}}             }                                     }         child{ node [arn_r] {47}             child{ node [arn_n] {38}                  child{ node [arn_r] {36}}                 child{ node [arn_r] {39}}             }             child{ node [arn_n] {51}                 child{ node [arn_r] {49}}                 child{ node [arn_x] {}}             }         }     ;      \end{tikzpicture}     \end{document}


title: Rotate Tikzpicture including nodes

text: Is there any simple way to rotate a whole tikzpicture environment? If I apply the tikzpicture option [rotate=ang] nodes seem to be unaffected. In other words, I want to do               \begin{tikzpicture}[rotate=ang]        "stuff to be rotated"     \end{tikzpicture}      and the whole picture, should be rotated; including all nodes.


title: package keyval error undefined color beamer

text: When i compile the following code, i get the package keyval error, undefined code. Please help!               \documentclass{beamer}          \usepackage[frenchb]{babel}     \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \usepackage{newcent}     \usepackage{color}          \usetheme{Warsaw}          \setbeamercolor{normal text}{teal}          \begin{document}          \begin{frame}          \setbeamertemplate{background canvas}[vertical shading][top=white,bottom=blue]     Texte n'ayant pas encore subi de changement de couleur.          \end{frame}          \end{document}


title: Good format for homeworks in LyX

text: I am using LyX to type in my homework solutions, but I don't like my format. The homework itself is in the format of questions 1,2,... and each question has sub-questions: 1.1,1.2,... etc In the current way I dislike two things:   1. There is no space between question (this makes it hard to search for a solution for some question).   2. I am using ctrl+b to make the numbering (of the question I am answering) easily seen, but it doesn't help too much Is there a better way to type in homework in Lyx ? Maybe some kind of pre- defined format ? **ADDED** : This is an example of one of my solutions: https://www.dropbox.com/s/1f1v5x0wthjh2k4/HW2.pdf Code: https://www.dropbox.com/s/l92icwwtbjo2pf4/HW2.lyx


title: Looking for an “S” symbol

text: I can’t figure out what this ![enter image description here](http://i.stack.imgur.com/JmS1D.jpg) symbol is. It is used in the context of “column space of a matrix **X** ”. It is not one of the Greek letters and my guess is that it is just an ordinary “S” with some sort of text style. I have looked through all common ones but could not find an appropriate one.


title: htlatex with article vs memoir

text: Why does the following document (with article document class):               \documentclass{article}     \begin{document}     \begin{tabular}{c|c}     \hline     1 & 2 \\     \hline          \hline     5 & 6 \\     \hline     \end{tabular}     \end{document}      creates a perfect html doc. While the following (using memoir) produces the error:               \documentclass{memoir}     \begin{document}     \begin{tabular}{c|c}     \hline     1 & 2 \\     \hline          \hline     5 & 6 \\     \hline     \end{tabular}     \end{document}      Following is the error               l.3 --- TeX4ht warning --- \halign translated into linear text ---     ! Missing number, treated as zero.     <to be read again>                         \ar:cnt      l.4 \hline      Note: Both produce completely perfect pdfs.


title: Is it possible to make an image gallery with tikz images?

text: I create many images with TikZ and I would like to make an image gallery. It should look like this: ![enter image description here](http://i.stack.imgur.com/YMPIg.png) The gallery should   * put the image in front of a (gray) background   * resize the image to a maximum width / height (and leave the aspect ratio intact) It would be nice if I could put the images in seperate files and use something like               \begin{gallery}         \input{tikz/myImage1.tex}[Some title]         \input{tikz/myImage2.tex}[another title]         \input{tikz/mathImage.tex}[This is a visualization of $f(x, y) = x^2 y^2$]     \end{gallery}      * * * This is what I've got so far (code also at GitHub):               \documentclass[a4paper,12pt]{article}     \usepackage{amssymb,amsmath} % needed for math     \usepackage{standalone} % needed for includestandalone     \usepackage[utf8]{inputenc} % this is needed for umlauts     \usepackage[ngerman]{babel} % this is needed for umlauts     \usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf          \usepackage{adjustbox}     \usepackage{xcolor}     \definecolor{myLightGray}{HTML}{F9F9F9}     \definecolor{borderColor}{HTML}{CCCCCC}          \usepackage{tikz} % needed for includestandalone     \usetikzlibrary{arrows,positioning, calc}          \tikzset{         pil/.style={->,thick}     }          \newenvironment{gallery}{}{}          \begin{document}     Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam      nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam      erat,      sed diam voluptua. At vero eos et accusam et justo duo dolores et ea      rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem      ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur      sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore      et dolore magna aliquyam erat, sed diam voluptua. At vero eos et      accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,      no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum      dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod      tempor invidunt ut labore et dolore magna aliquyam erat, sed diam      voluptua. At vero eos et accusam et justo duo dolores et ea rebum.      Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum      dolor sit amet.             \noindent     \begin{gallery}         \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{dot-product-1}}         \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{dot-product-2}}         \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{dot-product-3-1}}         \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{dot-product-6}}         \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{equilateral-triangle}}         \adjustbox{width=4cm,height=4cm,keepaspectratio,bgcolor=myLightGray,cfbox=borderColor 1px 0px 2px}{\includestandalone{equilateral-triangle-heights}}     \end{gallery}          Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse      molestie consequat, vel illum dolore eu feugiat nulla facilisis at      vero eros et accumsan et iusto odio dignissim qui blandit praesent      luptatum zzril delenit augue duis dolore te feugait nulla facilisi.      Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam      nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat      volutpat.             \end{document}      * * * Which produces: ![gallery so far](http://i.stack.imgur.com/6DIec.png) I've used `\includestandalone`, but with this I had to add the style defined in `\tikzset` in `dot-product-1.tex` to the main document. Thats not good.


title: Insert a figure on odd pages

text: I would like to insert a logo on each odd pages of my document (but the first) I know how to do it for each page but cannot figure out how to only do it on odd pages. So I have               \makeatletter     \AddToShipoutPicture*{%                 \setlength{\@tempdimb}{0.24\paperwidth}%                 \setlength{\@tempdimc}{1.795\paperheight}%                 \setlength{\unitlength}{0.5pt}%                 \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%             \includegraphics[width=0.25 \textwidth]{logo.eps}                 }%     }     \makeatother      I guess my issue is I do not really know how to put "if" conditions in that code! Could anyone help me on that?


title: Extending underline up to the right side

text: I need to create command that underlines some given text that takes several lines. And the underline of the last line should be extended up to the right side of page. When I need just to underline multiline text I use `\ul` from `soul` package. But I couldn't find any trick to extend last line. Something like `\ul{Last line\hfill\mbox{}}` gives nothing. Using `\soulregister{\hfill}{0}` doesn't help, too. Even if I force line break, `\hfill` will be ignored, i.e. `\ul{Last line\hfill\mbox{}\linebreak}` gives line with huge space between `Last` and `line` and no space after `line`. The only way to get something close to desired that I've found is the following.               \documentclass{article}     \usepackage{soul}          \newcommand{\raisedrule}[1]{\leaders\hbox{\rule[#1]{1pt}{0.4pt}}\hfill}     \newcommand{\longunderline}[1]{\ul{#1}\raisedrule{-3.5pt}\mbox{}}     \soulregister{\hfill}{0}          \begin{document}         \longunderline{Some long text. Some long text. Some long text. Some long text. Some long text. Some long text.}              \longunderline{Some short text.}              \ul{Oh, \hfill.}     \end{document}      However height of raise of rule may depend on text and there is some break between underline and rule after text. So my solution is really bad. Do you see something better? More complex case when I need to make exact number of undelined lines, supposing that text is always short enough to fit into desired number of lines, but not always long enough, i.e. some lines may be completely blank. Any idea? **EDIT** Using `ulem` and `\uline` instead of `soul` and `\ul` allows to “underline” `\hfill`. However it gives new problem loosing hyphenation. More interesting that it is possible to “help” it to make hyphen.               \documentclass{article}     \usepackage{soul}     \usepackage{ulem}          \pagestyle{empty}     \soulregister{\hfill}{0}          \begin{document}         \uline{Some long text. Some long text. Some long text. Some long text. Somelongword. Some long text.\hfill}              \uline{Some long text. Some long text. Some long text. Some long text. Somelong\-word. Some long text.\hfill}              \ul{Some long text. Some long text. Some long text. Some long text. Somelongword. Some long text.\hfill}     \end{document}      ![enter image description here](http://i.stack.imgur.com/UDdDV.png) Middle version is what I want to get, but now it is needed to allow hyphen by hand. **EDIT 2** One more example. Here `\uline` makes overfull while `\ul` does not make neither overfull nor underfull.               \documentclass{article}     \usepackage{soul}     \usepackage{ulem}          \begin{document}         \Huge         \ul{Some long text. Some long text. Some long text. Some long text. Some long text. Some long text.}              \uline{Some long text. Some long text. Some long text. Some long text. Some long text. Some long text.}     \end{document}      ![enter image description here](http://i.stack.imgur.com/yrJbg.png)


title: Auctex: how to cause math mode dollars to be closed automatically with electric-pair

text: I use electric-pair mode to cause brackets to be automatically closed for me, so that when I enter `(`, `{` or `[`, the closing bracket is automatically also entered into the buffer and the cursor is placed between them. However, I cannot seem to get it to treat `$` the same way. Perhaps it is related to the fact that `TeX-insert-dollar` is bound to `$`, and that presumably electric- pair doesn't treat `$` the same way as `(`. I've tried fiddling along these lines, but I can't get the behaviour I want.


title: Different margins for text and figures

text: Is it possible to have it so that the text has smaller left and right margins than figures? I am using `memoir`.


title: Formatting citations

text: I need that all citations done will be in `teal` and in `boldface`. I can do something like ` \textbf{\textcolor{teal}{\cite{something}}}`, but what is a better way? EDIT: For simplicity, just consider this MWE:               \documentclass{beamer}          \begin{document}          \begin{frame}     This is \textbf{\textcolor{teal}{\cite{NAME}}}     \end{frame}          \begin{thebibliography}{5}     \bibitem[Something]{NAME} ABC \newblock XYZ     \end{thebibliography}          \end{document}


title: Acronym at sentence start: capital or not?

text: The recommended way of typesetting acronyms is using small caps, e.g.:               This technique is called Remote Procedure Calling or {\scshape rpc}.      However, if the acronym occurs at the beginning of the sentence, would you capitalize its first letter or not?               {\scshape rpc} is the name of this technique.\\     {\scshape Rpc} is the name of this technique.         ![enter image description here](http://i.stack.imgur.com/Zzm6R.png) Which one would be most appropriate and why?


title: Can Emacs org-mode be used to createToDo's linked to a line in a LaTeX source?

text: For some time now I'm tracking my tasks and ToDos (privately and for work) with `Emacs org-mode`( http://orgmode.org/ ) and I am very happy with it. There is a large project in my life (my Ph. D. thesis), for sure written with LaTeX on MacOS X :-) , which creates a lot of todos related to my writing. In the past I have tried different approaches with limited success, to add notes and todos directly to my LaTeX source code and display them in the PDF for review and action. The problem was, that there was no external list where I could re-arrange, tag or prioritize those tasks and remarks. Now, as I'm finally starting to like Emacs (which I never had used before org- mode), I wonder if I could use Emacs AucTEX for editing and compiling my large document **and** directly inserting notes in the source code, which I could keep track of with org-mode.   * Does anyone do that or is there a tutorial to do so?   * I assume that just inserting org-mode lines like `* TODO [#B] rewrite this section"`would conflict with LaTeX code.   * Maybe there is a way to create kind of a permanent anchor at the current position in the LaTeX code and create an org-mode ToDO in my org-files which contains a hyperlink that lets me jump later (and even if the .tex file has changed) directly from `org-mode` to the place in the LaTeX source, where I want to edit something later?   * It would be great, if I could add a note which is shown in the LaTeX pdf directly and link the corresponding line/place in the .tex source with a TODO in an org-file


title: modify output of citet/citep

text: How to get the "&" between two references while using `citet/citep`? For example, `\citet{Jon88,jan90}`, the output would be -" Jone 1988; Jame 1990 ". But I wish to get- "Jone 1988 & Jame 1990". Similarly for multiple references, how to get the "&" for the last reference? For example, `\citet{Jon88,jan90,jer92}`, the output would be -"Jone 1988; Jame 1990; jerry 1992". But I wish to get- "Jone 1988; Jame 1990 & Jerry 1992"


title: Page numbers being cut off every time I add a picture

text: I've got a silly problem every time I add a picture to my document the page numbers get cut off as shown in the picture: ![enter image description here](http://i.stack.imgur.com/v54Gk.png) This is what I am using to import the image in my latex file: Right at the top:               \usepackage{graphicx}      and then:               \begin{figure}     \centering     \includegraphics{pic.png}     \end{figure}      Any ideas why this is happening?


title: Arranging multiple plots in a grid inside a figure/subfloat

text: I have a grid of pie charts which go into `subfloat`s. The number is odd, and I would like to have them on a 3x2 grid, where the cell in the bottom left is empty. I have simulated this by putting an empty subfloat in the following example, but obviously that's not good, as I get a sub-caption labelled "(e)" and the caption count is increased:               \documentclass{article}     \usepackage{graphicx}     \usepackage{subfig}          \begin{document}          \begin{figure}     \centering     \subfloat[first]{       \includegraphics[width=65mm]{test.pdf}     }     \subfloat[second]{       \includegraphics[width=65mm]{test.pdf}     }     \hspace{0mm}     \subfloat[third]{       \includegraphics[width=65mm]{test.pdf}     }     \subfloat[forth]{       \includegraphics[width=65mm]{test.pdf}     }     \hspace{0mm}     \subfloat[]{   % ???       \includegraphics[width=65mm]{empty.pdf}     }     \subfloat[fifth]{       \includegraphics[width=65mm]{test.pdf}     }     \caption{caption}     \end{figure}          \end{document}      ![enter image description here](http://i.stack.imgur.com/WQJok.png)


title: How to use multiple sets of numbered appendices with bookmarks and the memoir documentclass?

text: # The Goal To have a `memoir` document with several chapters with the running story, a set of appendices called _Appendices_ , with additional data in the main document, and a second set of appendices called _Attachments_ , with additional maps etc that are provided separately, with only a small description of the attachment in the main document. Preferably the Appendices are numbered with `\Alph` (by default), and the Attachments numbered with `\Roman`. # The Problem Redefining the `\appendix[|toc|page]name` commands is no problem, and either a second `\appendix` or a `\setcounter{chapter}{0}` restarts numbering, and `\renewcommand{\thechapter}{\Roman{chapter}}` works fine to update the titles. However, `bookmarks` adds the page anchors as `Appendix.[A|B|C|...]`, for both the _Appendices_ and _Attachments_ , and thus complains > destination with the same identifier (name{appendix.A}) has been already > used, duplicate ignored # The Question How can I either rename the identifier prefix to attachment, or the change identifier numbering to Roman numerals such that the bookmarks in the TOC are correct? The Code               \documentclass{memoir}          \usepackage{bookmark}          \begin{document}     \tableofcontents     \chapter{Foo}          \appendix     \appendixpage     \chapter{First appendix}          %\backmatter % Really only a temporary workaround, no real solution     \renewcommand{\appendixname}{Attachment}     \renewcommand{\appendixpagename}{Attachments}     \renewcommand{\appendixtocname}{Attachments}     % Either of the following two lines resets the chapter numbers, neither fixes the problem     %\appendix     \setcounter{chapter}{0}     \renewcommand{\thechapter}{\Roman{chapter}}     \appendixpage     \chapter{A Separate File}          \end{document}      ## A Workaround A workaround to get correct bookmarks in the TOC is to move the `\backmatter` command before the _Attachments_. However, this disables numbering altogether, and I do need them. Also this only works if there are two sets of appendices, but perhaps someone else might need three or four sets of appendices, and then this does not work anymore.


title: TikZ: surface of revolution of a hyperbolic trajectory

text: So I have no idea on how to construct a surface of revolution of a hyperbolic trajectory from a injection point. For simplicity, let's make the injection point `(0, 0)`. Unfortunately, I don't know what to give as a MWE for a starting point. I could give the very basic though.               \documentclass[convert = false, tikz]{standalone}     % maybe these packages will be needed     %\usetikzlibrary{arrows}     %\usetikzlibrary{calc}     %\usetikzlibrary{intersections}     \begin{document}     \begin{tikzpicture}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/zPx2d.png) **I am still looking for a solution that can come close to replication the image since I want to put a circle with the earth where the trajectories meet.**


title: Tikz externalize: use external PDF or render by tikz, do not create external PDF

text: I have texlive 2012 and tikz. Is it possible to get the following behavior? > With external library to tikz, use external image, if it is available. > However, if it is not available, render the picture by tikz. Do NOT create > external PDF. I have some files where externalization fails, probably because tikz code is nested in several more complicated complicated macros (which include writing code into auxiliary TeX file and so on). We are speaking about approx 500 files which are complied in a bash a script if the input for these files changes (fixing typos, improving the template, adding new type of interactivity in PDF). I think, I can check if the pdf files with corresponding names exist and turn the externalization on/off from command line, but I wonder is there is some cleaner solution in TeX only. Typical example of the PDF file is http://user.mendelu.cz/marik/temp/000040.pdf * * * Update The following file does not compile with \tikzexternalize               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{external}     \tikzexternalize     \begin{document}          \def\mypic#1{       \begin{tikzpicture}\clip (-1,-1) rectangle (1,2);         \draw[red] plot (\x,{#1});     \end{tikzpicture}     }          \mypic{(\x)^2}     \begin{tikzpicture}\clip (-1,-1) rectangle (1,2);     \draw[red] plot (\x,{\x*\x*\x});     \end{tikzpicture}          \end{document}      The reason why we do need externalize is the fact, that we will create TeX files on a specific web site on the fly and compile. We would like to save the computer load and we also want not to edit the TeX files again. The idea was   * We compile on a fast machine, most of the tikz pictures will be externalized, some of them not   * We move the PDF files to the server.    * If something has to be compiled on the server, and PDF file is available, use this PDF file. If not, compile as with regular tikz. We want to have a functionality similar to the answer of benwilfut but without modifying TeX files.


title: \qed or \qedhere at the end of split environment

text: While I was trying to improve my latest document with respect to its `\qed` symbols at the end of `amsthm`'s `proof` environment i came across an interesting point. Assume the proof ends with some formula, that is finally representing the form the lemma/theorem proposes. Something like               \documentclass{scrartcl}     \usepackage[fleqn]{amsmath}     \usepackage{amsthm,amstext,amsfonts,bm,amssymb}          \begin{document}     \begin{proof}     ...     \begin{equation}         \begin{split}             A&= B \\              &= C\\              &= D&\qedhere         \end{split}     \end{equation}     \end{proof}     \end{document}      While using `\qedhere` just in `equation` or `align` would put the symbol below any number (or at least to that side for `euqation*`), here the symbol is placed far to the left, even with using the additional column with `&`. Putting it after `\end{split}` would center it vertically with respect to the three columns, so my question is How can I get the `\qed` symbol to the bottom right (text border) of an (equation-)split environment? Where I would prefer a global solution for all `split`s where I mention `\qedhere` at the end.


title: read strings from csv file for usage as figure meta data

text: I got the following problem, I use pgfplots(table) to generate plots and tables in my latex document from generated data. I would like to read additional information from a metadata file. The reason for that, is that the data depends on the architecture it was generated on, which I would like to write into the caption. Therefore I would like to store a caption, as well as other metainfo (like axis labels) in a csv file for each plot/table and read it when generating my document. I found datatool, xstring and some other packages which might be useful but could not figure out a way to achieve what I try to do. Thanks in advance for any help!


title: How to scale entire document including Maths symbols?

text: I'm trying to make a cheat-sheet for my Math class. I wonder is there a way to scale the entire document so that I can fit more formulas and theorems into it. It doesn't need to be super tiny though. I tried tiny font, but it still waste too much space. Have anyone done it before could share me some experiences? Thanks in advance.


title: Simultaneous collaborative editing of a LaTeX file

text: Are there any tools for simultaneous collaborative editing of a .tex file? The practices I know (and practice) in writing scientific papers are:   * e-mailing each new version to the collaborators,   * working in a same Dropbox folder. However, both are not meant for **simultaneous** editing, and are somewhat annoying. EDIT: A list is also here:   http://en.wikibooks.org/wiki/LaTeX/Collaborative_Writing_of_LaTeX_Documents


title: Latex editor and online sharing

text: Are there some Latex editors that allow the online sharing? I mean an editor that when a shared file is opened by two users (for example using dropbox), each person can see on time what the other person is writing. I know that Sharelatex do it, but I would like to get an editor installed directly on my mac.


title: Customize beamer template to vary field for each slide?

text: I would like to use the lower left corner normally reserved for "author (institution)" (I am using the Boadilla template) to include additional text (like references/sources for figures) specific to that slide. Is this easy to customize? If so... how can I go about changing that for individual slides?


title: Footnotes, Cross-Referencing and Updating

text: I am new to LaTeX and wondering if it is worth using to write up my doctorate. I am a lawyer and there is one thing – perhaps specific to lawyers – which I cannot work out if LaTeX can do. (I have looked on message boards and don’t think it’s dealt with there, but do please point me in the right direction if I’ve missed something. For our references (at least, in my institution) we need a long title and a short title. So, for instance, I might have footnote 100 as: > Cantiare San Rocco v Clyde Shipbuilding & Engineering Co Ltd [1924] AC 226 > HL and footnote 150 as: > Cantiare San Rocco (n 100). So far, so good. However, suppose I wanted to move the text attached to footnote 100 so it appears after footnote 150 (say, 200). I then need footnote 150 to appear as: > Cantiare San Rocco v Clyde Shipbuilding & Engineering Co Ltd [1924] AC 226 > HL and footnote 200 to read: > Cantiare San Rocco (n 150). Is it possible for LaTeX to automatically update footnotes in this way? A further complication is that I really need the initial cross-reference (i.e. to footnote 100) to point to the footnote the citation is in rather than the precise footnote it is in at the moment. That is because I might move Cantiare San Rocco v Clyde Shipbuilding & Engineering Co Ltd [1924] AC 226 HL out of footnote 100 without moving the text attached to that footnote. That is, footnote 100 will not move. I hope that I’ve made my question clear enough, but do forgive me if I haven’t. It may be that LaTeX can’t do this – but I know that Zotero has this functionality (Endnote doesn’t) so I figure it must in principle be possible. Thanks!


title: TikZ: Decoration with 1cm zigzag in the middle of a link

text: How do I make a TikZ decoration with a 1cm zigzag in the middle? Here's what I have so far, but it didn't work:               \pgfdeclaremetadecoration{timearrow}{initial}{         \state{initial}[width=0pt, next state=arrow] {             \pgfsetlinewidth{1pt}             \pgfset{/pgf/decoration/segment length=8pt}             \pgfmathtruncatemacro{\blah}{\pgfmetadecoratedpathlength/2 - 1cm}         }         \state{arrow}[switch if less than=1cm to final,                       width=\blah ,                       next state=zigzag] {             \decoration{curveto}             \beforedecoration {\pgfpathmoveto{\pgfpointmetadecoratedpathfirst}}         }         \state{zigzag}[width=1cm,                        next state=final] {             \decoration{zigzag}         }         \state{final}[] {             \decoration{curveto}             \beforedecoration{\pgfpathmoveto{\pgfpointmetadecoratedpathfirst}}         }     }


title: TikZ with circuit-libs: Change appearance of voltage source

text: How can I change the appearence of a `voltage source` in TikZ. The picture shows the actual and the desired result (faked manually) ![actual and desired result](http://i.stack.imgur.com/PvRcR.png) **Code**               \documentclass{minimal}          \usepackage{tikz}     \usetikzlibrary{circuits.ee.IEC}          \begin{document}     \begin{tikzpicture}[circuit ee IEC]       \node at (0,0) [anchor=south west] {desired};       \node at (0,2) [anchor=south west] {actual};     % actual:       \draw (0,2) to[voltage source={info={$U_\sim$}}] ++(5,0);     % desired (faked):       \draw [radius=1pt,fill=white] (0,0) -- ++(2.25,0) circle ++(0.5,0) circle --++(2.25,0);       \fill [radius=0.8pt,fill=white] (0,0) -- ++(2.25,0) circle ++(0.5,0) circle --++(2.25,0);       \path (0,0) -- (5,0) node [midway,above] {$U_\sim$};     \end{tikzpicture}     \end{document}


title: Format \ref output from enumeration item to not include section name

text: I'm referencing items in an enumerated list from another document (requirements.tex). I can do that, but I get extraneous information I haven't been able to remove. Requirements.tex:               \documentclass{article}     \usepackage{graphicx}     \usepackage{mathtools}     \usepackage{hyperref}     \usepackage{enumerate}     \begin{document}          \section{Engineering Requirements}     \begin{enumerate}         \item The system shall turn trees into money. \label{Req:treesToMoney}         \item The system must be able to process five trees per second. \label{Req:treeRate}     \end{enumerate}     \end{document}      design.tex:               \documentclass[hidelinks]{article}     \usepackage{graphicx}     \usepackage{geometry}     \usepackage{fancyhdr}     \usepackage{amsmath, amsthm ,amssymb}     \usepackage{graphicx}     \usepackage{xr}          \externaldocument{../requirements/Requirements}          \begin{document}     Requirement \ref{Req:treesToMoney} is a functional requirement.      \end{document}        The output from design.tex is something like: > Requirement 1Engineering RequirementsItem.1 is a functional requirement. This output looks awful. Not only do I get the extraneous section name and Item.#, that information isn't separated by spaces. Is there a way to format the output of \ref? Possibly to exclude the extraneous information but at-least to separate the different pieces of information by spaces.


title: beamer and tikz-uml package are not working together

text: I use pretty cool `tikz-uml` in my LaTeX with class `report`. Its works very well!!! Today, I’m start prepare presentation with `beamer`. I import all my `tikzpicture`s from `report` TeX without problems. But, when I start import UML diagrams (class/sequence diagrams) I have error. This happens on line `\usepackage{tikz-uml}` , in the beginning of my `beamer` file. Here is error output:               (/usr/share/texmf/tex/latex/lm/omllmm.fd)     (/usr/share/texmf/tex/latex/lm/omslmsy.fd)     (/usr/share/texmf/tex/latex/lm/omxlmex.fd)     (/usr/share/texmf-texlive/tex/latex/amsfonts/umsa.fd)     (/usr/share/texmf-texlive/tex/latex/amsfonts/umsb.fd)     Overfull \hbox (8.46622pt too wide) in paragraph at lines 299--299      []           Overfull \hbox (89.75618pt too wide) has occurred while \output is active       [][]       [11]       Overfull \hbox (17.70491pt too wide) in paragraph at lines 325--325        []        (/usr/share/texmf/tex/latex/lm/t1lmr.fd)             LaTeX Font Warning: Font shape `T1/lmss/m/sc' in size <10.95> not available        (Font)              Font shape `T1/lmr/m/sc' tried instead on input line 325.                  LaTeX Font Warning: Font shape `T1/lmss/m/sc' in size <10> not available        (Font)              Font shape `T1/lmr/m/sc' tried instead on input line 325.                  Overfull \hbox (89.75618pt too wide) has occurred while \output is active         [][]         [12]         ! No room for a new \count .         \ch@ck ...\else \errmessage {No room for a new #3}                                                           \fi                                                           l.349 \end{frame}      I have verson 0.98 of `tikz-uml.sty`, downloaded from site. Here is beginning of my TeX file               \documentclass{beamer}     \usepackage[utf8]{inputenc} %russian support     %\usepackage[francais]{babel} %francais, ussian support     \usepackage[francais]{babel}     \usepackage[T1]{fontenc} %set standart fonts T1. It is Sexy!;Accent codés dans le font          \usepackage{graphicx}     \usepackage {listings}     \usepackage{beamerthemesplit} % biblio items     \usepackage{url} % url               %TIKZ pictures packages     \usepackage{calc}   %chart diagrm     \usepackage{ifthen} %chart diagrm     \usepackage{tikz}   %chart diagrm     \usetikzlibrary{shapes,arrows}   % to draw flow diagramm     \usetikzlibrary{arrows,automata} %to draw fsm          \usepackage{subfig}     %\setlength{\textwidth}{5.1in} % set default alinéa; pour les paresses. Not use it!     \usepackage{times}     \usepackage{float} %subfloat constructions for graphiques                     %listings     \usepackage{color}     \usepackage{xcolor}     \usepackage{listings}               \usepackage{ucs}            %russian support; dependency for lstset     \lstset{ %listing: add accents to 'caption'; default settings for each listings     extendedchars=\true,     inputencoding=utf8x     }     %\DeclareCaptionFont{white}{\color{white}}     %\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}     %\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}               %FOR DIAGRAMM CHARTSS     \newcommand{\slice}[4]{       \pgfmathparse{0.5*#1+0.5*#2}       \let\midangle\pgfmathresult            % slice       \draw[thick,fill=red!50] (0,0) -- (#1:1) arc (#1:#2:1) -- cycle;            % outer label       \node[label=\midangle:#4] at (\midangle:1) {};            % inner label       \pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}       \let\temp\pgfmathresult       \pgfmathparse{max(\temp,-0.5) + 0.8}       \let\innerpos\pgfmathresult       \node at (\midangle:\innerpos) {#3};     }          \usepackage{lmodern} %Make text more precise               \usepackage{subfloat}          %%UML, Stata machines     \usepackage{xstring}     \usepackage{pgfopts}     \usepackage{tikz-uml}     ...


title: Redefine apostrophes to prevent bad kerning

text: The apostrophe in Adobe’s Minion Pro font has a kerning that is much too tight for typesetting French, where sequences of letters like **l’a** or **d’e** or **j'a** are common. One solution I found is to wrap the apostrophe in a box, which prevents kerning with surrounding elements and gives a much nicer result: ![enter image description here](http://i.stack.imgur.com/4529q.png) (regular kerning is at the top, with my workaround below). I can redefine the “nice apostrophe”, a.k.a. U+2019, a.k.a. right single quotation mark, by the following command:               \DeclareUnicodeCharacter{2019}{\mbox{'}}      However, this doesn't work for the regular ASCII apostrophe, U+0027. So, how do you suggest I change that (in a way that doesn't affect the working of `'` as a prime in math mode)? It would be an added bonus if the solution could avoid breaking hyphenation…


title: Tabbing environment in tabular environment cancels set table width

text: I have a table with a tabbing environment in it. I don't want the table to exceed a certain width, but the tabbing environment seems to ignore this. So while inserting a lot of 'blas' in row 5 results in the blas being distributed over several lines (which is what I want), the blas in the tabbing environment in row 2 make the table wider (which I want to avoid). How can I use a tabbing environment in a tabular environment while preserving the set width of my table? Thanks in advance for any replies! My code:               \documentclass{article}     \usepackage{graphicx}     \begin{document}          \begin{tabular}{|l|p{7cm}|}      \hline     1 & xxx \\ \hline     2  &                \begin{tabbing}     xxx:\hspace{6mm} \= \textbullet  \hspace{0.01mm} bla bla bla bla bla bla bla bla bla bla bla bla \\     \> \textbullet  \hspace{0.01mm} xxx\\     \> \textbullet  \hspace{0.01mm} xxx\\     xxx: \> \textbullet  \hspace{0.01mm} xxx\\     \> \textbullet  \hspace{0.01mm} xxx\\     xxx: \> \textbullet  \hspace{0.01mm} xxx\\     \> \textbullet  \hspace{0.01mm} xxx\\     xxx: \> \textbullet  \hspace{0.01mm} xxx\\     \> \textbullet  \hspace{0.01mm} xxx\\     \end{tabbing}          \\ \hline     3 & xxx \\ \hline     4 & xxx\\ \hline     5 & bla blabla blabla bla bla bla bla bla bla bla bla bla\\ \hline     6 & xxx\\ \hline     7 & xxx\\       \hline     \end{tabular}          \end{document}


title: Center image in landscape mode

text: I've used the `\usepackage{pdflscape}` instruction and the following code for inserting an image in a landscape oriented page.               \begin{landscape}          \begin{figure}[p!]     \centering     \includegraphics[scale=0.4]{./images/SelectDVA.png}     \caption{DVA selection Use Case.}     \end{figure}          \end{landscape}      This is the outcome: ![enter image description here](http://i.stack.imgur.com/qEOxV.png) I'd like the image to be centred vertically and horizontally, put playing with `\vspace` or `\hspace` didn't help me. What is the correct way of doing it?


title: Is it possible to close a subsection?

text: So I want to insert text that's not related to a subsection, but rather to the top section the subsection parts from. This is the idea:               \section{fruits}     All these are fruits:     \subsection{orange}     color orange     \subsection{grape}     color purple     \subsection{banana}     Yellow and long fruit     \end{subsection}     a fruit is a part of a flowering plant that derives from specific tissues of the flower, one or more ovaries, and in some cases accessory tissues     \section{foo}     \subsection{unrelated bar}      So what I want to be able to do, is make a short description, a few examples with subsections and explanations about them, and then, close the last subsection, and continue the explanation on what fruits are and, taking stuff from subsections, draw similarities. Is this possible? Thanks! Edit: It has been suggested to use `description` and `enumerate`, but the problem here is that I want the subsections to contain item lists, descriptions and enumerations, and I also want the subsections to appear in the ToC so people can quickly jump to each detailed description of each fruit (in this example). Edit 2: This is the ideal output generated with MS Word (I'm not sure, I'm assuming the person has used Word). ![enter image description here](http://i.stack.imgur.com/wkwBt.png) As you can see, there's an space before after the end of the subsection 5.6, like if it was starting a new section, as well as the adequate indentation.


title: TikZ/PGF figures messed in DVI

text: I have a graph. This is my code.                \documentclass[10pt]{article}         \usepackage{pgf,tikz}         \usetikzlibrary{arrows,patterns}         \pagestyle{empty}              \definecolor{ttqqcc}{rgb}{0.2,0,0.8}         \definecolor{ffqqtt}{rgb}{1,0,0.2}         \definecolor{ttqqff}{rgb}{0.2,0,1}         \definecolor{uququq}{rgb}{0.25,0.25,0.25}              \begin{document}              \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]              \draw[->] (-3.63,0) -- (3.67,0);         \foreach \x in {-3,-2,-1,1,2,3}           \draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt)              node[below] {\footnotesize $\x$};         \draw[color=black] (3.48,0.07) node [anchor=south west] { $x$};              \draw[->] (0,-1.93) -- (0,5.57);         \foreach \y in {-1,1,2,3,4,5}           \draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt)              node[left] {\footnotesize $\y$};         \draw[color=black] (0.06,5.19) node [anchor=west] { $y$};              \draw (0pt,-10pt) node[right] {\footnotesize $0$};              \clip(-3.63,-1.93) rectangle (3.67,5.57);         \draw[pattern color=ffqqtt,pattern=north east lines,fill opacity=0.1, smooth,samples=50,domain=0:1.0]          plot(\x,{\x^4-4*\x^2+3}) -- (1,0) -- (0,0) -- cycle;         \draw[pattern color=ttqqcc,pattern=crosshatch,fill opacity=0.1, smooth,samples=50,domain=1.0:1.7320508075688772]          plot(\x,{\x^4-4*\x^2+3}) -- (1.73,0) -- (1,0) -- cycle;              \begin{scope}[xscale=-1]         \draw[pattern color=ffqqtt,pattern=north east lines,fill opacity=0.1, smooth,samples=50,domain=0:1.0]            plot(\x,{\x^4-4*\x^2+3}) -- (1,0) -- (0,0) -- cycle;         \draw[pattern color=ttqqcc,pattern=crosshatch,fill opacity=0.1, smooth,samples=50,domain=1.0:1.7320508075688772]            plot(\x,{\x^4-4*\x^2+3}) -- (1.73,0) -- (1,0) -- cycle;         \end{scope}              \draw[smooth,samples=100,domain=-3.6342419080068153:3.665758091993186] plot(\x,{(\x)^4-4*(\x)^2+3});              \fill [color=uququq] (-1.73,0) circle (1.5pt);              \fill [color=uququq] (-1,0) circle (1.5pt);              \fill [color=uququq] (1,0) circle (1.5pt);              \fill [color=uququq] (1.73,0) circle (1.5pt);              \end{tikzpicture}         \end{document}      When I see the DVI output DVI, I have ![enter image description here](http://i.stack.imgur.com/U49SK.gif) And if I look at the PDF file, I have ![enter image description here](http://i.stack.imgur.com/kI0ag.gif)


title: How can I use Source Sans Pro in Tex-Live 2012?

text: I use TeX Live 2012 on an updated Ubuntu 12.10 machine with Latexila. I intended using Adobe's open source font Source Sans Pro in my latest paper. I followed the instruction on the LaTeX Font Catalogue page, inserted               \usepackage[default,oldstyle]{sourcesanspro}      but Latexila only spits out the following error:               File 'sourcesanspro.sty' not found.      I already installed all LaTeX extra packages, I could find with `apt-get`. Any ideas?


title: "Find next" broken in pdflatex output in Skim on OS X Mountain Lion

text: When loading into Skim a pdf document that was created using pdflatex, the "Find next" action (e.g., Cmd-G or clicking the right arrow in the find bar) works incorrectly. In a document with tens of occurrences of a particular word, it will find the first few occurrences and then stop moving on to the next occurrence. Searching backwards does seem to work. This is super annoying for large documents :( Preview is able to search the document just fine. A bug has been filed in Skim, but the author appears to think this is a Mountain Lion issue. I've added my own comments. link to the bug I suspect the issue has to do with a combination of the way that pdflatex is writing the pdf and the way that PDFkit (or whatever Skim is using) searches the document. Has anyone else had this problem? Does anyone have a suggestion to fix it? (using dvi as an intermediary isn't really convenient in my case)


title: converting a hyperlinked pdf \includepdf to black and white

text: Most recent scientific articles come with hyperlinks within the document (generally linking citations to the references; e.g. this file). These are often coloured. When including them into a TeX file, the hyperlinks break but the colour denoting the links remain. Is there a way to include the pdf in black and white?               \documentclass{article}          \usepackage{pdfpages}          \begin{document}          \includepdf{file.pdf}          \end{document}      UPDATE: I found a work around for this in the form of "printing" a new PDF in greyscale (Print/advanced/colour - change to Composite Gray). If someone knows of some TeX based method...please do let me know!


title: displaying TeX in web app

text: First I tried to ask this question on stackoverflow but it looks like that it's TeX specific. I'm having a TeX file on server, and need to display it in web page. The first thing I was thinking about was `MathJax` javascript TeX renderer (it renders TeX inside browser). But it does not support stuff like `renewcommand` or `\begin{theorem}...\end{theorem}`. So it looks like everything should be compiled on server side. And here are my questions:   1. Compiling TeX to MathML will be the easiest way for me... Still I can't find TeX to MathML converter? Can you advise me an adequate TeX to MathML converter?   2. Does MathML covers common part of tex stuff?   3. Is it possible to change automaticaly (e.g. with some utility) stuff like `\begin{theorem}...\end{theorem}` to something that can be compiled without any packages (so that I can path TeX to MathJAX interpriter).


title: Problem having an aligned column using multicol

text: I'm having problems getting a good-looking column. (The text is in Danish.) What can I do to get them aligned?               \section{Teknologianalyse}     \subsection{Teknik}     \begin{multicols}{2}             \noindent{}\textbf{De maskiner som vi brugte under arbejdsprocessen:}             \begin{enumerate}             \item En mekanisk automatisk metalsav.             \item Søljebord.             \item Svejsebord/maskine.             \item Sav.             \item Fil.         \item Skruetvinge.         \end{enumerate}     \columnbreak         \textbf{Krav til arbejderne som betjener maskinerne:}         \begin{enumerate}             \item At de har hænder, øjne og fødder.             \item At de kan benytte en mekanisk automatisk sav.             \item At de kan svejse.             \item At de kan benytte en sav.             \item At de kan benytte en fil.              \item At de kan benytte en skruetvinge.             \item At de kan benytte et søljebord.         \end{enumerate}     \end{multicols}          ![output](http://i.stack.imgur.com/t1ldO.png)


title: write to back page of part

text: I have defined (using koma-script), that chapters only start on the right side. The same applies to part pages. So far this is ok. But now I want to insert a contents list (using `titletoc`) on the back side (left) of the part page. It shall list only the chapters, thus it will never span more than one page. However by default the next opened page after `\part` is on the right side. There are some hacks to solve this problem (found here)               \makeatletter\@openrightfalse\makeatother     \part{Part Name}     This is the text I put on the back side of the part page     \makeatletter\@openrighttrue\makeatother      But I would like to have this configured in the preamble and have a clean code in the document. Is this possible somehow? EDIT: From the previous comments I could find out that `\renewcommand{\partheademptypage}{}` works until I reformat the part page using titlesec.               \documentclass{scrbook}     \usepackage{xcolor}     \usepackage{titlesec}     \usepackage{titletoc}             \titleformat{\part}[frame]       {\usekomafont{part}\Large\color{black}\centering}    % format       % label: PART I       {\enspace \LARGE\MakeUppercase{\partname}%                     \centering \Huge~\thepart \enspace }%         % sep (from partnumber)       {1.5\baselineskip}       % (before chaptertitle and after)       {\color{black}\filcenter}                 \begin{document}     \mainmatter          \newcommand{\PartialToc}{%     \startcontents[part]     \section*{Contents}     \printcontents[part]{}{0}{\setcounter{tocdepth}{0}}     }          \renewcommand{\partheademptypage}{}%          \part{Part Heading}     \PartialToc     \chapter{first}     \chapter{second}          \end{document}


title: How to connect two parents to the same child, with parents not in the same tree?

text: I'm trying to draw a specific tree, with two parents node linked to the same child. The problem is that one of the parent is outside the main tree. Here's the code I have for the moment:               \documentclass{article}     \usepackage{tikz-qtree,tikz-qtree-compat}     %\usepackage{gb4e}     \usepackage{forest}          \begin{document}          %\begin{exe}     \begin{forest}     qtree edges/.style={for tree= parent anchor=north, child anchor=south}        [A, grow=north            [C, name=C, grow'=north                [D, grow=north ]                [E, name=t5, grow=north ]            ]            [B, grow=north ]        ]        \hspace{0.8cm}        [$F$, name=F, grow=north ]        %\draw (F.north) -- (C.south);     \end{forest}     %\end{exe}          \end{document}      I'd like the nodes F and C to be connected. I don't know why, but if I delete the dollar signs, node F doesn't even appear on my document. Another thing is that I want the forest environment to be embedded in an example environment, but this doesn't work either. Thanks in advance for your help!


title: pst-optexp: draw prism compressor

text: I wanted to draw a prism compressor with the respective beamlines. The general setup works, but the exact control of the beam alignment within the prisms fails. Here is the code that I have so far:               \begin{pspicture}     \pnode(0,0){S1}     \pnode(2,2){S2}          \definecolor[ps]{bl}{rgb}{%     tx@addDict begin Red Green Blue end}%           \optprism[prismangle=30,compname=P1](0,0)(2,2)(3,1)     \optprism[prismangle=30](3,1)(4,0)(4.5,0.5)      \mirror[mirrortype=extended](4.5,0.5)(5,1)(4.5,0.5){M1}          \drawbeam[linecolor=orange](S1){P1}      \addtopsstyle{Beam}{linecolor=bl,linewidth=0.1\pslinewidth}      \multido{\i=0+1}{60}{%     \pstVerb{%     \i\space 620 590 sub 59 div mul 590 add tx@addDict begin wavelengthToRGB end }%     \drawbeam[beamangle=\i\space 0.1 mul 3 sub]{1}{2-}      %\drawbeam[loadbeampoints]{2}{3}     }%          \end{pspicture}      ![enter image description here](http://i.stack.imgur.com/8ctpg.png) "Prism compressor" Two problems:   * how to get the ray drawn within the first prism   * how to align the rays horizontally within the second prism If someone could help me on that I would be really grateful :). Thanks in advance


title: "Segmentation fault (core dumped)" with LuaLaTeX

text: I'm trying to compile a 3D surface made by 10000 data points with tickzpicture. However, when I compile the `.tex` file with `lualatex`               lualatex --shell-escape myfile.tex      I receive the following error:               (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfgSegmentation fault (core dumped)      The script I'm using inside my `.tex` file looks like               \begin{tikzpicture}          \begin{axis}[      width=5.33027777777778in,      height=4.26422222222222in,      area legend,      view={-37.5}{30},      scale only axis,      xmin=-5, xmax=5,      xtick={\empty},      ymin=-1, ymax=7,      ytick={\empty},      every outer z axis line/.append style={white},      every z tick label/.append style={font=\color{white}},      zmin=-0.458, zmax=5.285,      ztick={\empty},      axis x line*=bottom,      axis y line*=left,      axis z line*=left]           \addplot3[%       surf,       shader=faceted interp,       colormap/jet,       mesh/rows=100]       table[row sep=crcr,header=false] {       -5 -1 -0.0254428632617659\\       -5 -0.919191919191919 -0.0254428632617659\\       -5 -0.838383838383838 -0.0254428632617659\\       -5 -0.757575757575758 -0.0254428632617659\\       -5 -0.676767676767677 -0.0254428632617659\\       -5 -0.595959595959596 -0.0254428632617659\\       ............       ............       5 6.67676767676768 -0.0254428632617659\\       5 6.75757575757576 -0.0254428632617659\\       5 6.83838383838384 -0.0254428632617659\\       5 6.91919191919192 -0.0254428632617659\\       5 7 -0.0254428632617659};       \end{axis}       \end{tikzpicture}      Do you know how to solve this problem? Thanks


title: Why is newtcbtheorem not working while tcbmaketheorem does?

text: EDIT: It was simply a matter of outdated package versions. On a mac there are those useful commands sudo tlmgr update –self and after that sudo tlmgr update –all. The following throws the error "undefined control sequence", but when I switch to \tcbmaketheorem instead it works. Whats the matter?               \documentclass{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[ngerman]{babel}     \usepackage{amsmath}          \usepackage[theorems]{tcolorbox}          %\tcbmaketheorem{mytheo}{My Theorem}{colback=green!5,colframe=green!35!black,fonttitle=\bfseries}{th}          \newtcbtheorem{mytheo}{My Theorem}{colback=green!5,colframe=green!35!black,fonttitle=\bfseries}{th}          \begin{document}          \begin{mytheo}{}{}     Great theorem with beautiful box.     \end{mytheo}          \end{document}


title: Remove page numbers from footer for multi-page Table of Contents

text: I am trying to remove page numbers that appear by default in footer of Table of Contents. I was able to do this for one page long Table of Contents like this one:               \documentclass[final]{book}     \pagestyle{plain}          \begin{document}          \tableofcontents     \thispagestyle{empty}          \chapter{Chapter 1}     \chapter{Chapter 2}     \chapter{Chapter 3}     \chapter{Chapter 4}          \end{document}      However, for long Table of Contents take 2 or more pages `\thispagestyle{empty}` only removes page number in footer from last page of Table of Contents, but all other pages have this number:               \documentclass[final]{book}     \pagestyle{plain}          \begin{document}          \tableofcontents     \thispagestyle{empty}          \chapter{Chapter 1}     \chapter{Chapter 2}     \chapter{Chapter 3}     \chapter{Chapter 4}     \chapter{Chapter 5}     \chapter{Chapter 6}     \chapter{Chapter 7}     \chapter{Chapter 8}     \chapter{Chapter 9}     \chapter{Chapter 10}     \chapter{Chapter 11}     \chapter{Chapter 12}     \chapter{Chapter 13}     \chapter{Chapter 14}     \chapter{Chapter 15}     \chapter{Chapter 16}     \chapter{Chapter 17}     \chapter{Chapter 18}     \chapter{Chapter 19}     \chapter{Chapter 20}     \chapter{Chapter 21}     \chapter{Chapter 22}     \chapter{Chapter 23}     \chapter{Chapter 24}     \chapter{Chapter 25}     \chapter{Chapter 26}     \chapter{Chapter 27}     \chapter{Chapter 28}     \chapter{Chapter 29}     \chapter{Chapter 30}     \chapter{Chapter 31}     \chapter{Chapter 32}     \chapter{Chapter 33}     \chapter{Chapter 34}     \chapter{Chapter 35}     \chapter{Chapter 36}     \chapter{Chapter 37}     \chapter{Chapter 38}     \chapter{Chapter 39}     \chapter{Chapter 40}     \chapter{Chapter 41}     \chapter{Chapter 42}     \chapter{Chapter 43}     \chapter{Chapter 44}     \chapter{Chapter 45}     \chapter{Chapter 46}     \chapter{Chapter 47}     \chapter{Chapter 48}     \chapter{Chapter 49}     \chapter{Chapter 50}     \chapter{Chapter 51}     \chapter{Chapter 52}     \chapter{Chapter 53}     \chapter{Chapter 54}     \chapter{Chapter 55}     \chapter{Chapter 56}     \chapter{Chapter 57}     \chapter{Chapter 58}     \chapter{Chapter 59}     \chapter{Chapter 60}     \chapter{Chapter 61}     \chapter{Chapter 62}          \end{document}      I have discovered that I can use `\addtocontents{toc}{\protect\thispagestyle{empty}}` before `\chapter` entry to remove footer from page on which given chapter will appear in Table of Contents. However, it requires me to either add `\addtocontents{toc}{\protect\thispagestyle{empty}}` before each `\chapter` command or at least do it manually for one chapter on each page of Table of Contents. Is there any more straightforward way to remove footers from Table of Contents no matter how long Table of Content is?


title: Customizing titlesec

text: I've read through section 2 and 3 of `titlesec`'s package documentation, and unfortunately I find it extremely cryptic, so I've given up trying to come to terms with it. Please bear with me as I'm just posting an example of how I want my `\section` headings to look.               \documentclass{article}     \usepackage{titlesec}     \begin{document}     \section{My first section}     Here is the content of my first section.\\          % Below how I want it to look     \noindent {\large{\textbf{1. My first section}}}\\     Here is the content of my first section.\\     \end{document}      ![enter image description here](http://i.stack.imgur.com/5PKVK.png)


title: How to control initial and final positions of edges?

text: This is my first attemp with Tikz environment. I'm drawing the diagram that follows: ![Tikz diagram](http://i.stack.imgur.com/vy9zM.png) How can I draw the edges in a way that the ends match with the center of the rectangles' edges (red dots in the picture)? Code:               \tikzset{       block/.style={rectangle, text width=8em, minimum height=4ex, text centered, draw=black, fill=orange!30},       arrow/.style={draw, thick,->,>=stealth},     }     \begin{tikzpicture}[node distance=1cm]         \node [block] (dev-team) {Development team};         \node [block, below=of dev-team] (git-repo) {Git repository};         \node [block, below=of git-repo] (jenkins) {Jenkins};         \node [block, right=of jenkins, yshift=1.5cm] (unit-tests) {unit tests};         \node [block, right=of jenkins, yshift=0.5cm] (localisation) {localisation};         \node [block, right=of jenkins, yshift=-0.5cm] (code-quality) {code quality};         \node [block, right=of jenkins, yshift=-1.5cm] (ui-automation)  {UI automation};         \node [block, below=of jenkins] (testflight) {Testflight};         \node [block, below=of testflight, text width=2em, xshift=-1.5cm] (PO) {PO};         \node [block, below=of testflight, text width=2em, xshift=-0.5cm] (BA) {BA};         \node [block, below=of testflight, text width=2em, xshift=0.5cm] (DM) {DM};         \node [block, below=of testflight, text width=2em, xshift=1.5cm] (QA) {QA};              \path [arrow] (dev-team) -- (git-repo);         \path [arrow] (git-repo) -- (jenkins);         \path [arrow] (jenkins) -- (unit-tests);         \path [arrow] (jenkins) -- (localisation);         \path [arrow] (jenkins) -- (code-quality);         \path [arrow] (jenkins) -- (ui-automation);         \path [arrow] (jenkins) -- (testflight);         \path [arrow] (testflight) -- (PO);         \path [arrow] (testflight) -- (BA);         \path [arrow] (testflight) -- (DM);         \path [arrow] (testflight) -- (QA);     \end{tikzpicture}      By the way, is there any better option to position the "childs" of nodes 'Jenkins' and 'Testflight'? I've tried the `child` option but with no success.


title: Problem in LaTeXDiff

text: When i tried to to see Changes for the below text using latexdiff its not giving the correct result Eg: > exciting and bold new book -> Orignal file > > excitig and bod new bok -> Modified file **Result from latexdiff.exe**               \DIFdelbegin \DIFdel{exciting and bold new book }\DIFdelend     \DIFaddbegin \DIFadd{excitig and bod new bok }\DIFaddend      **Required result (Manually coded)**               \DIFdelbegin \DIFdel{exciting }\DIFdelend and \DIFdelbegin     \DIFdel{bold }\DIFdelend new \DIFdelbegin \DIFdel{book }\DIFdelend     \DIFaddbegin \DIFadd{excitig }\DIFaddend and \DIFaddbegin \DIFadd{bod     }\DIFaddend new \DIFaddbegin \DIFadd{bok }\DIFaddend


title: Inline math overflow does not happen with minipages, but everywhere else

text: When writing in a minipage environment, unsplittable math formulas **never** spill into the right margin. Instead, spacing is introduced in the current line and the formula is moved to the next line. However, doing the same in free flowing "top level" text results in a visually most unappealing overflow, see example below. I had a look at the manual penalties, but nothing seems to fit. How do I reproduce the minipage overflow behaviour everywhere else?               \documentclass[a4paper]{letter}         \begin{document}         \begin{minipage}{12cm}     This is an example paragraph inside a \textit{minipage} showing how text          should flow, notice how nothing is pushed onto the margins:          \textbf{Lorem} ipsum dolor sit amet, consectetur adipisicing elit, sed do       tempor incididunt ut  et dolore magna aliqua. Ut enim ad minim veniam      quodque $P, Q , R , S ,T \ldots, X, Y, Z$, quis nostrud exercitation ullamco.     \end{minipage}       \vspace{2em}          This is an example paragraph without any sections inside the main document,       and here the math environment overflows into the margin:          \textbf{Lorem} ipsum dolor sit amet, consectetur adipisicing elit, sed do       tempor incididunt ut  et dolore magna aliqua. Ut enim ad minim veniam      quodque $P, Q , R , S ,T \ldots, X, Y, Z$, quis nostrud exercitation ullamco.       \end{document}      ![Example](http://i.stack.imgur.com/F68be.png)


title: Two-column LaTeX class for a photobook

text: I am looking for a solution to produce a two-column(ed) LaTeX-based photobook. Text and comments should go on the outer column (in a two-sided document)--something like a wide outer margin. Photos (along with their optional captions) should be placed in the inner column (which will be wider than the "text"-column). Very important detail: the idea is to have landscape pages, wide enough to present photos that can be actually seen. As an extra, the class should be compatible with some kind of a thumb-index for the chapters, placed on the outer side of the page, from top to bottom, counting from the first to the last chapter. Should I start scratching my own class (or layout for LyX)?


title: Trying to install mmd LaTeX support – how do I get to my texmf folder?

text: I'm trying to install multi markdown LaTeX support so I can use MathJax in my markdown, but I can't find the texmf folder on my mac. More specifically, when I run `kpsewhich` I get `~/Library/texmf`, but then when I try to access the folder through the Finder or Dock it won't show up. I tried running `mktexlsr`, but I got               mktexlsr: /Users/jeff/Library/texmf: not a directory, skipping.     mktexlsr: /usr/local/texlive/2011/../texmf-local: directory not writable. Skipping...     mktexlsr: /usr/local/texlive/2011/texmf: directory not writable. Skipping...     mktexlsr: /usr/local/texlive/2011/texmf-config: directory not writable. Skipping...     mktexlsr: /usr/local/texlive/2011/texmf-dist: directory not writable. Skipping...     mktexlsr: /usr/local/texlive/2011/texmf-var: directory not writable. Skipping...     mktexlsr: Done.      Any idea what's going on?


title: Can you invoke stylizing commands in a .bib-file when using the BiBLaTeX apa package?

text: **This question has been heavily rewritten. That's why some of the comments and answers might be a little bit odd (they were responses to earlier versions of the question).** I'm using the BiBLaTeX apa package in conjunction with a .bib-file (generated by Mendeley) to create references. Now, in one of my titles, I would like some words to be in italics. Is it possible to invoke stylizing commands directly in the .bib-file? Minimal (non)working example (taken from Lockstep):               \documentclass{article}          \usepackage[style=apa]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @thesis{A01,       author = {Author, A.},       year = {2001},       title = {This is a thesis title with some \mkbibemph{emphasized words}},     }     @book{B02,       author = {Buthor, B.},       year = {2002},       title = {This is a book title with some \mkbibemph{emphasized words}},     }     \end{filecontents}          \addbibresource{\jobname.bib}          \nocite{*}          \begin{document}          \printbibliography          \end{document}      This just prints the whole title with italics (as specified by the apa style).


title: TikZ: Use --cycle in circuits

text: Why does the `--cycle` command doesn’t work in a circuit drawn with the TikZ library `circuits.ee.IEC`? The problem with manually draw the last connection is that the ends are not joined. ![problem](http://i.stack.imgur.com/gbiIo.png)   I made the lines very thick to demonstrate the problem of not joining … Is it possible to fix this or at least join the path manually? **Code**               \documentclass{minimal}          \usepackage{tikz}     \usetikzlibrary{circuits.ee.IEC}          \begin{document}     \begin{tikzpicture}[circuit ee IEC, line width=5pt]     \draw (0,0) -- ++(0,2) node [above] {without objects}%         -- ++(4,0) -- ++(0,-2)%         --cycle node [below] {works};          \draw (0,-4.5) to[voltage source] ++(0,2) node [above] {with -\/-cycle}%         -- ++(4,0) to[resistor] ++(0,-2)%         --cycle node [below] {no connection};          \draw (0,-9) to[voltage source] ++(0,2) node [above] {manually}%         -- ++(4,0) to[resistor] ++(0,-2)%         -- ++(-4,0) node [below] {not joined};     \end{tikzpicture}     \end{document}


title: How to draw Sequence diagram with TeX

text: I want to draw Sequence diagram in latex. I want it to to be like the following diagram: ![Use case diagram](http://i.stack.imgur.com/Dh9gD.png) any hint? update [I changed the title from "use case" to "Sequence" , so sorry ]


title: Listing with two columns in a single fancy frame

text: I am playing a little with `lstlistings` and I wonder whether such a thing would be achievable for all my listings: ![listing](http://i.stack.imgur.com/IKLun.png) How to achieve this kind of things? Note : I am searching for a solution I can apply to all my listings (by defining a new command for example), and which will automatically balance the two columns...


title: Smart shifting of words in a TikZ box

text: In a style file for thesis and dissertations in LaTeX, for my school, certain sections have green boxes. Those sections are abstract, acknowledgements, dedication, and citation. Is there a way to have words shifted according to length? ![enter image description here](http://i.stack.imgur.com/2gODQ.png) ![enter image description here](http://i.stack.imgur.com/AwD7I.png) Abstract looks okay but Acknowledgements stick out on the right too much. Is it possible to have LaTeX determine based on word length how to shift the title? In the style file, the environments are set up:               % abstract environment                                                                 \renewenvironment{abstract}{                                                             \begin{tikzpicture}[remember picture, overlay]%                                          \pgftext[right, x = 12cm, y = 0.2cm]{                                                    \color{uvmgreen}\Huge\bfseries Abstract};%                                           \draw[fill = uvmgreen, draw = uvmgreen] (15.5,-.75) rectangle (10,1);%                 \clip (15.5,-.75) rectangle (10,1);                                                    \pgftext[right, x = 12cm, y = 0.2cm]{                                                    \color{white}\Huge\bfseries Abstract};%                                          \end{tikzpicture}%                                                                          \vspace{40pt}                                                                          }{\newpage}      and               % acknowledgements environment                                                         \newenvironment{acknowledgements}{                                                       \thispagestyle{plain}                                                                  \begin{tikzpicture}[remember picture, overlay]%                                          \pgftext[right, x = 12cm, y = 0.2cm]{                                                    \color{uvmgreen}\Huge\bfseries Acknowled\smash{g}ements};%                           \draw[fill = uvmgreen, draw = uvmgreen] (15.5,-.75) rectangle (10,1);%                 \clip (15.5,-.75) rectangle (10,1);                                                    \pgftext[right, x = 12cm, y = 0.2cm]{                                                    \color{white}\Huge\bfseries Acknowled\smash{g}ements};%                            \end{tikzpicture}%                                                                          \vspace{40pt}                                                                          \addcontentsline{toc}{section}{Acknowledgements}                                       \begin{doublespace}}{\end{doublespace}                                                 \newpage       }


title: changing the general theme of math fonts

text: I'm using latex templates which is producing a particular kind of math font, shown below. ![enter image description here](http://i.stack.imgur.com/7vJYI.png) How can I change it to produce something like following? I'm particularly interested in changing the math font. ![enter image description here](http://i.stack.imgur.com/7tOCh.png) Is there any specific package that I should exclude? unfortunately there are a couple of style and cls files and I'm not sure what is responsible for this change in font.


title: How can I define my font size?

text: According to LyX Wiki, I can define my font size by means of this code (in case of 10.5pt) :               \usepackage{type1cm}          \renewcommand\normalsize{%        \@setfontsize\normalsize{10.5pt}{12pt}        \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@        \abovedisplayshortskip \z@ \@plus3\p@        \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@        \belowdisplayskip \abovedisplayskip        \let\@listi\@listI}\normalsize        But how can I calculate this value in case of 14pt, 16pt, 18pt?


title: How can I draw an arc with varying line thickness?

text: I'm trying to redraw existing figures with _TikZ_ as an exercise to learn it. This time I have choosen an interesting logo and I'm having difficulties drawing the arc. Here is the logo ![original logo](http://i.stack.imgur.com/xML1L.png) I noticed that the red arc looks almost like an incomplete ellipse and found the interesting `arc` option in the manual. This may not be the best approach since the end of the arc (close to the last 'n') seems to deviate from the ellipse shape. Anyway, what I'm really interested is not the arc construction (I may file a separate question for that), but how I could draw the arc with varying **line thickness**. I.e. it starts very thin, and smoothly increases and decreases again. Here's what I got so far (note: font is not right ... probably propriatary):               \begin{tikzpicture}[font=\sffamily]       % font: the 'n' has some funny curvature            \definecolor{infblue}{HTML}{0066b3}       \definecolor{infred}{HTML}{ec1840}       % guessing boundary conditions       \coordinate (upperred) at (2.,1.6);       \coordinate (rightred) at (3.6,0.7);            % helpers        \fill[gray] (upperred) circle (1pt);       \fill[gray] (rightred) circle (1pt);       %\draw (upperred) .. controls (-4,4) and (6,0) .. (rightred);       %\draw plot [smooth,tension=0.7] coordinates {(upperred) (Iblue) (rightred)};            \node[rectangle] at (2,1) {\Huge \textcolor{infblue}{Infineon}};       \draw[thick,infred] (upperred) arc[start angle=85,end angle=330,x radius=18mm, y radius=6mm];            % todo: initial 'I' is shorter. replace.       \end{tikzpicture}      ![tikz generated logo](http://i.stack.imgur.com/XVuw2.png)


title: Is there a way to use unicode-math in a limited fashion?

text: At the moment, I am using `mathspec` and some traditional math packages such as `mathpazo` to typeset my mathematics. The results are mostly satisfactory, but I would like to expand the repertoire of some of the math alphabets by replacing the traditional packages with fragments of Unicode math fonts; in particular I want to be able to use the blackboard bold letters and numbers from STIX for `\mathbb`. Now, the problem with using the `unicode-math` package is that it is totally incompatible with traditional math packages: it insists on replacing all the existing math symbol macros with Unicode ones even when no Unicode math font has been selected yet. I am not yet prepared to switch over to Unicode math as my main mathematics typesetting system, as it is very hard to get it to reproduce my current output. Yet, `unicode-math` seems to be the only way of using fragments of Unicode math fonts in the way that I want; the `\setmathxxx` commands from `mathspec` expect old-style fonts with the styled glyphs in the Basic Latin block.


title: How to view details in the PRAGMA showcase?

text: The PRAGMA Web site has a link to a showcase. However, when I open this PDF, it shows just 2 pages with a black menu. It must contain links to other documents, but it does not work. I have tried Evince and Adobe Acrobat. How can I view this showcase?


title: Use csdef variables before defining them

text: I'm trying to create a grade table. This is a follow up question to Create an array of variables. The issue is that the grading table sits below the questions. The way I want is that the questions should appear after the grading table.However, if the grading table is at the top, I will have not called any `csdef` commands and I won't have any output. (I've tried and this is true, of course.) So, how can I put the grading table before the actual questions. p.s. I've tried `totcount` package and replaced `csdef`s with `\newtotcounter` but it gives huge number of errors which I have no clue about. My MWE is here:               \documentclass{article}      \usepackage{etoolbox}          \newcounter{cnt}          \newcommand\addtext[1]{%         \stepcounter{cnt}%         \csdef{text\thecnt}{#1}}          \newcommand\gettext[1]{%           \csuse{text#1}}          \begin{document}          Question 1: Blah.      \addtext{3}          Question 2: Blah.     \addtext{2}          Question 3: Blah.     \addtext{4}               \begin{tabular}{ |l|c@{} *{\thecnt}{c|} } % the first row is hidden       \hline       \newcounter{colnum}%       \setcounter{colnum}{0}%       Q. No.:\hfill &        \whileboolexpr       { test {\ifnumcomp{\value{colnum}}{<}{\thecnt}} }%           {&\stepcounter{colnum}\thecolnum}\\       \hline       Score: &                    \setcounter{colnum}{0}           \whileboolexpr           { test {\ifnumcomp{\value{colnum}}{<}{\thecnt}} }%           {&\stepcounter{colnum}\hspace{1cm}}\\       \hline       Total: &            \setcounter{colnum}{0}           \whileboolexpr           { test {\ifnumcomp{\value{colnum}}{<}{\thecnt}} }%           {&\stepcounter{colnum}\gettext{\thecolnum}}\\       \hline             \end{tabular}     \end{document}


title: Expand a macro with parameters in tabular head

text: My eventual goal is to create my own tabular-like environment in which all entries are in math-mode by default, let's call it `fancytable`. (One requirement is that the first column be separated from the others by a line, but that shouldn't be the main problem.) In Math mode in tabular without having to use $...$ everywhere I found how to approach the problem:               \documentclass{article}     \usepackage{array}     \usepackage{tabularx}     \begin{document}     \begin{tabular}{ >{$}c<{$} | >{$}c<{$} >{$}c<{$} }         x & x^2 & x^3\\         y & y^2 & y^4     \end{tabular}     \end{document}      but this is not what I'm looking for. (Note I am including `tabularx` because I need it for other purposes, I think it is relevant to mention.) The tabular may become large (say 15 columns) so writing `>{$}c<{$}` every time would be tedious. Also, some day I might change my mind and choose another lay-out, and changing all tables isn't really a thing I'm looking forward to. That's why I try to make it an environment.   Recently I asked how to copy and print a string a few times, in A command which concatenates a string an arbitrary number of times. So currently I have a command `\repeatstring` available and I expect to need it as in `\repeatstring{5}{>{$}c<{$}}`. (I have included its current definition below)   The first thing I tried is something like               \documentclass{article}     \usepackage{array}     \usepackage{tabularx}     % definition of \repeatstring left out, see below     \newenvironment{fancytable}[1]%         {\begin{tabular}{ >{$}c<{$} | \repeatstring{#1}{>{$}c<{$}} } }         {\end{tabular}}     \begin{document}     \begin{fancytable}{2} % the argument of fancytable is 1 less than the desired number of columns         x & x^2 & x^3\\         y & y^2 & y^4     \end{fancytable}     \end{document}      but `tabular` does not accept arbitrary commands in its header. I read trough How do I expand a macro into a tabular head? and tried to adapt the answers given there. Meanwhile I figured out that I should somehow expand `\repeatstring` before `tabular` sees what's going on in its head. I think defining a new `columntype` every time a `fancytable` is created is not a good thing to do (I fail to do it anyway, getting the same error as with the above approach). Some tries:               \documentclass{article}     \usepackage{array}     \usepackage{tabularx}     % definition of \repeatstring left out, see below     \newcommand\buildtabularhead{}     \newenvironment{fancytable}[1]%         {%         \renewcommand\buildtabularhead{ >{$}c<{$} | \repeatstring{#1}{>{$}c<{$}} }%         \expandafter\tabular\expandafter{\buildtabularhead}}         {\endtabular}     \begin{document}     \begin{fancytable}{2}         x & x^2 & x^3\\         y & y^2 & y^4     \end{fancytable}     \end{document}      (based on Matthew Leingang's answer) but I keep getting > Package array Error: Illegal pream-token (\repeatstring): `c' used. as usual. The same with Bruno Le Floch's answer:               \documentclass{article}     \usepackage{array}     \usepackage{tabularx}     % definition of \repeatstring left out, see below     \makeatletter         \newcolumntype{\expand}{}         \long\@namedef{NC@rewrite@\string\expand}{\expandafter\NC@find}     \makeatother     \newcommand\mypream{}     \newenvironment{fancytable}[1]%         {%         \renewcommand\mypream{ >{$}c<{$} | \repeatstring{#1}{>{$}c<{$}} }%         \begin{tabular}{\expand\mypream}}         {\endtabular}     \begin{document}     \begin{fancytable}{2}         x & x^2 & x^3\\         y & y^2 & y^4     \end{fancytable}     \end{document}      I really don't know what to do. I read When to use \edef, \noexpand, and \expandafter? but didn't achieve to use `\expandafter` of `\edef` in the right way. I always and up with > Package array Error: Illegal pream-token (\repeatstring or \edef or > \expandafter or \setcounter): `c' used. `\setcounter` comes from my current definition of `\repeatstring` when I expand it:               \usepackage{etoolbox}     \newcounter{countdown}     \newcommand\concathere{}     \newcommand\repeatstring[2]{         \setcounter{countdown}{#1}         \renewcommand\concathere{}         \whileboolexpr{test {\ifnumcomp{\thecountdown}{>}{0}}}{             \addtocounter{countdown}{-1}             \appto\concathere{#2}             }         \concathere         }


title: How can I efficiently convert TEI documents into LaTeX?

text: TEI documents have a lot of information that can be used for representation and style. Are there any tools to convert such documents into LaTeX in order to create good pdf/html etc. versions?


title: Are there any free fraktura fonts available for LaTeX?

text: Where can I find them?


title: How to limit the header to the page width?

text: I have a long header and LaTeX inserts it broader than the page width. ![output](http://i.stack.imgur.com/9NREg.jpg) How do make the header fit on the page?


title: Globally enable a font feature for libertine package

text: The `libertine` package works with both PDFLaTeX and XeLaTeX; with the latter it automatically loads and uses `fontspec` for OpenType font loading. Also with XeLaTeX, it's possible to load a font feature called Variant 01, which changes the ÖÜ characters to the style used in Hungarian (accents closer together). However, I cannot make this feature global:               \documentclass{book}     \usepackage{fontspec}     \defaultfontfeatures{Variant=01}     \usepackage{libertine}     \begin{document}     \addfontfeature{Variant=01}     \section{Ö}     \Large\textbf{Ö}     \end{document}      ![ö](http://i.stack.imgur.com/DBJsP.png) Is there a way to use Variant 01 in the whole document, while retaining the convenience of `\usepackage{libertine}`?


title: Sort bibliography corresponding to .bib file

text: I have created a `.bib` file containing the resources. I'm using `biblatex` with `style=numeric`. I would like to have in my document the numbers order as I have inserted the corresponding resources in the `.bib` file.


title: Array cell highlighting tikz

text: I'm beginning to write up a PhD thesis and am pretty new to LaTeX. I'm trying to explain a numerical method I'm using and in doing this I wish to highlight sections of arrays to aid explanation. The entries in the arrays I am highlighting vary in size i.e. they could be integers or longer terms of several characters in length. The first option I have found is using the `\cellcolor` command which gives a block color over the `array` element. I found this doesn't give the best presentation however (I know this sounds fussy but I'm sure a better presented thesis comes across better). Anyway, the second option I found was through some examples found on here mainly by defining nodes and creating a rectangle with customisable options etc. The examples look nice and I'd like to use something similar for my work but, and here it comes, all of the examples work well for simple arrays, i.e. arrays full of integers, but not so well for the arrays I am using. You will notice from the code I have uploaded that the rectangle fitting fits directly to the text within the array cell, this causes the two highlighted regions to be misaligned due to the node placement/fitting of each highlight. The `\cellcolor` command however, fits around the entire 'cell' not the text within the cell. **I want to highlight a boxed region around the array cells not the text.** This will allow any sized array cells to be highlighted without the need for complicated fitting around odd sized array cells. Finally, I am very new to LaTeX and even 'newer' to drawing in LaTeX. I apologise if I have not explained properly etc, please let me know and I will do my best to edit my response/question.               \documentclass[a4paper,10pt,english,table]{article}          %Document normal packages     \usepackage{hyperref}     \usepackage{amsmath,amssymb}     \usepackage{graphicx}     \usepackage{subfigure}     \usepackage{epstopdf}     \usepackage[parfill]{parskip}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{babel}     \usepackage{xcolor}          % Tikz drawing settings====================     \usepackage{tikz}     \usetikzlibrary{calc,fit}     \tikzset{%       highlight1/.style={rectangle,rounded corners,color=red!,fill=red!15,draw,fill opacity=0.5,thick,inner sep=0pt}     }     \tikzset{%       highlight2/.style={rectangle,rounded corners,color=green!,fill=green!15,draw,fill opacity=0.5,thick,inner sep=0pt}     }     \newcommand{\tikzmark}[2]{\tikz[overlay,remember picture,baseline=(#1.base)] \node (#1) {#2};}     %     \newcommand{\RHighlight}[1][submatrix]{%         \tikz[overlay,remember picture]{         \node[highlight1,fit=(left.north west) (right.south east)] (#1) {};}     }     \newcommand{\GHighlight}[1][submatrix]{%         \tikz[overlay,remember picture]{         \node[highlight2,fit=(left.north west) (right.south east)] (#1) {};}     }     % Tikz drawing settings====================          \begin{document}          Using 'cellcolor' command, note the array cells are highlighted and the two highlighted regions are nicely aligned.          \begin{equation}     \renewcommand{\arraystretch}{1.5}      A_{L}=\left[\begin{array}{cccc}     \cellcolor{green}-T^{1}_{11} & \cellcolor{green}0 &  0 & -T^{1}_{12} \\     \cellcolor{green}-T^{2}_{12} & \cellcolor{green}-T^{2}_{11} & 0 & 0 \\     \cellcolor{red}0 & \cellcolor{red}-T^{3}_{12} & \cellcolor{red}T^{3}_{11} & \cellcolor{red}0 \\     \cellcolor{red}0 & \cellcolor{red}0 & \cellcolor{red}0 & \cellcolor{red}0 \\     \end{array}\right] \left[\begin{array}{c}     \phi_{A} \\     \phi_{B} \\     \phi_{C} \\     \phi_{D}     \end{array}\right]     \label{eq:ALphif}     \end{equation}          Using an example taken from the website, note the mis-alignment and errors of highlighted regions crossing the brackets          \begin{equation}     \renewcommand{\arraystretch}{1.5}      A_{L}=\left[\begin{array}{cccc}     \tikzmark{left}{$-T^{1}_{11}$} & 0 &  0 & -T^{1}_{12} \\     -T^{2}_{12} & \tikzmark{right}{$-T^{2}_{11}$} & 0 & 0 \GHighlight \\     \tikzmark{left}{$0$} & -T^{3}_{12} & T^{3}_{11} & 0 \\     0 & 0 & 0 & \tikzmark{right}{$0$} \RHighlight\qquad \\     \end{array}\right] \left[\begin{array}{c}     \phi_{A} \\     \phi_{B} \\     \phi_{C} \\     \phi_{D}     \end{array}\right]     \label{eq:ALphif}     \end{equation}          \begin{equation}     \renewcommand{\arraystretch}{1.5}     B_{L}= \left[\begin{array}{ccc}     \tikzmark{left}{$(T^{1}_{11}+T^{1}_{12})$} & 0 & 0 \\     0 & (T^{2}_{11}+T^{2}_{12}) & \tikzmark{right}{$0$} \GHighlight \\      \tikzmark{left}{$0$} & 0 & (T^{3}_{11}+T^{3}_{12}) \\      0 & 0 & \tikzmark{right}{$0$} \RHighlight\qquad \\     \end{array}\right] \left[\begin{array}{c}     \phi_{1} \\     \phi_{2} \\     \phi_{3}     \end{array}\right]     \label{eq:BLphii}     \end{equation}          \begin{equation}     \renewcommand{\arraystretch}{1.5}      A_{R}= \left[\begin{array}{cccc}     \tikzmark{left}{$T^{2}_{22}$} & T^{2}_{21} & 0 & 0 \\     0 & \tikzmark{right}{$T^{3}_{22}$} & T^{3}_{21} & 0 \GHighlight \\      \tikzmark{left}{$0$} &  0 &  0 &  0 \\     T^{1}_{21} & 0 & 0 & \tikzmark{right}{$T^{1}_{22}$} \RHighlight\qquad \\     \end{array}\right] \left[\begin{array}{c}     \phi_{A} \\     \phi_{B} \\     \phi_{C} \\     \phi_{D}     \end{array}\right]     \label{eq:ARphif}     \end{equation}          \begin{equation}     \renewcommand{\arraystretch}{1.5}     B_{R}= \left[\begin{array}{ccc}     \tikzmark{left}{$0$} & -(T^{2}_{21}+T^{2}_{22}) & 0 \\     0 &  0 & \tikzmark{right}{$-(T^{3}_{21}+T^{3}_{22})$} \GHighlight \\      \tikzmark{left}{$0$} & 0 & 0 \\     -(T^{1}_{21}+T^{1}_{22}) & 0 & \tikzmark{right}{$0$} \RHighlight\qquad \\     \end{array}\right] \left[\begin{array}{c}     \phi_{1} \\     \phi_{2} \\     \phi_{3}     \end{array}\right]     \label{eq:BRphii}     \end{equation}     \end{document}      ![Intended result](http://i.stack.imgur.com/dTCwB.png) ![Bad results obtained](http://i.stack.imgur.com/OPiL4.png)


title: TeX fails to generate output with Hebrew text: Jerusalem font metric file missing

text: I have MiKTeX installed on a Windows machine. I have this simple document, where I'm trying to use Hebrew:               \documentclass[12pt]{article}     \usepackage{ucs}   % package to add unicode support     \usepackage[utf8x]{inputenc}  % adding the UTF-8 encoding     \usepackage[english,hebrew]{babel}     \usepackage{hebfont}     \begin{document}     \sethebrew     Hello world % \textshold{   שלום עולם!}     \end{document}      The compiler says to me:               Package babel Warning: No hyphenation patterns were loaded for     (babel)                the language `Hebrew'     (babel)                I will use the patterns loaded for \language=0 instead.          )) ("D:\MiKTeX 2.9\tex\generic\babel\lheenc.def")     ("D:\MiKTeX 2.9\tex\generic\babel\hebfont.sty") (C:\u1.aux)     ("D:\MiKTeX 2.9\tex\generic\babel\lhecmr.fd")     ("D:\MiKTeX 2.9\tex\latex\ucs\ucsencs.def")Running miktex-makemf.exe...     miktex-makemf: The jerus source file could not be found.     Running hbf2gf.exe...          hbf2gf (CJK ver. 4.8.0)          Couldn't find `jerus.cfg'     miktex-maketfm: No creation rule for font jerus10.          ! Font LHE/cmr/m/n/12=jerus10 at 12.0pt not loadable: Metric (TFM) file not found.      What is the problem?


title: Should LaTeX counters always be modified globally?

text: In this answer, egreg states that _"LaTeX counters should always be modified globally"_. However, the etoolbox package provides the `\defcounter` macro which will assign a value to a previously initialized counter _locally_ (but may be prefixed with `\global`). I have been using this macro e.g. to change the value of the `secnumdepth` counter inside a group:               \documentclass{article}          \usepackage{etoolbox}          \begin{document}          \section{bla}          \begingroup     \defcounter{secnumdepth}{-2}          \section{blubb}     \endgroup          \section{foo}          \end{document}      So: Is egreg's statement about always globally modifying counters correct? If so, why? If not, is the usage of `\defcounter` in my MWE still bad practice?