title: Biber broken on debian wheezy/sid texlive 2011

text: After an update of texlive 2011 (two days ago), biber (version 0.9.9) is completely broken. The solution found via google (deleting directory /tmp/par-.....) does not work. The Error is:               ~/Git/DISS$ biber -h     Can't load '/tmp/par-6772656269/cache-   ab06f20732bfab23dfa35f56998ad4edca61bee1/608da891.so'      for module XML::LibXML: /tmp/par-6772656269/cache-ab06f20732bfab23dfa35f56998ad4edca61bee1/libz.so.1:      version `ZLIB_1.2.3.3' not found (required by /usr/lib/../lib/libxml2.so.2) at /usr/local/perl/lib/5.14.1/x86_64-linux-thread-multi/DynaLoader.pm line 190.      at /usr/local/perl/lib/site_perl/5.14.1/PAR/Heavy.pm line 120     BEGIN failed--compilation aborted at XML/LibXML.pm line 153.     Compilation failed in require at XML/LibXML/Simple.pm line 16.     BEGIN failed--compilation aborted at XML/LibXML/Simple.pm line 16.     Compilation failed in require at Biber/LaTeX/Recode.pm line 9.     BEGIN failed--compilation aborted at Biber/LaTeX/Recode.pm line 9.     Compilation failed in require at Biber/Utils.pm line 21.     BEGIN failed--compilation aborted at Biber/Utils.pm line 21.     Compilation failed in require at Biber/Internals.pm line 8.     BEGIN failed--compilation aborted at Biber/Internals.pm line 8.     Compilation failed in require at (eval 22) line 2.     ...propagated at /usr/local/perl/lib/5.14.1/base.pm line 94.     BEGIN failed--compilation aborted at Biber.pm line 5.     Compilation failed in require at script/biber line 20.     BEGIN failed--compilation aborted at script/biber line 20.      Any ideas how to get rid of that problem? I should finish my thesis instead of fighting biber errors ;-/ Thanks in advance! # Some further information after searching quite a while and texlive reinstallation: biber searches in /usr/local/perl/lib/5.14.1/ which does not exist anymore after update. Thus, the error is related to a debian update and not the texlive update. The problem now is that I do not have a clue where biber gets that path from. If I know that I can adjust the path and it sould work. If it is "hardcoded" I will try to make a symbolic link tomorrow


title: How do I change the default typewriter font with XeTeX?

text: In this question, it is detailed how to convert a project to use TrueType or OpenType fonts by switching from LaTeX to XeLaTeX. I've successfully changed my build over to use XeTeX, but I'd like to leave the default font alone. Rather, I'd like to change the fixed width font instead. How does one do this?


title: How to include files from a directory specified by a concatenation of text and a macro?

text: This is almost certainly a silly mistake somewhere. I'm essentially trying to do what is being done here. My MWE project:               $ find ./     ./     ./common     ./common/preambleCommon.tex     ./mydoc     ./mydoc/mydoc.tex      mydoc.tex:               \documentclass{article}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                            %     \newcommand*{\commonDir}{../common/}%  %     \input{\commonDir{preambleCommon}}     %                                            %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}          Hello!          \mytestcmd          \end{document}      preambleCommon.tex:               \newcommand*{\mytestcmd}{Hello, from my test cmd.}      When I run `latex mydoc.tex`, this comes up:               ! LaTeX Error: File `../common/preambleCommon.tex' not found.      But if I do `ls ../common/preambleCommon.tex` it shows up.


title: Figure positions and sizing

text: I have the following figure code :               \begin{figure}[h]        \centering        \includegraphics[scale=.7,bb=0 0 804 401]{f5.png}        \caption{Case Adaptation \cite{16} }        \label{fig:f5}     \end{figure}      Even though this figure is not at the end of the document, it is not appear as it supposed to be. Instead, it comes at the end of the document! One more thing, why do I have to use the `bb` parameters for the PNG images? Is there any work around?


title: antt is not compatible with fontspec

text: The code               \documentclass{article}     %\usepackage{fontspec}     \usepackage[condensed,math]{anttor}     \usepackage[T1]{fontenc}     \begin{document}     0123$0123$     \end{document}      run well when I compiled with pdflatex; while               \documentclass{article}     \usepackage{fontspec}     \usepackage[condensed,math]{anttor}     \usepackage[T1]{fontenc}     \begin{document}     0123$0123$     \end{document}      not so well with xelatex. The numbers in math mode is typesetting in CM fonts. ![enter image description here](http://i.stack.imgur.com/1ndSR.png)


title: Incorrect page number in List of Listings

text: The problem I'm having is that page numbers, in a List of Listings, are frequently off by one page. I'm using the `listings` package and I have a List of Listings in the beginning of the document, generated by the command `\listoflistings`. I'm using the following environment for writing the listings.               \lstnewenvironment{javacode}[2]     {     \refstepcounter{listings}%     \label{lst:#2}%     \addcontentsline{lst}{listings}{\protect\numberline{\thelistings}#1}%     \lstset{language=Java,caption=#1,breaklines=true,breakatwhitespace=false,float=phtb}     }     {     }      The issue appears when there isn't enough space for the listing in a page and it is moved to the next one. In those cases, the page number that appears in the list of listing is off by one page, because the anchor remained in its place in the text, but the actual listing got moved to the next page. Do you know how can I fix it? I guess a solution should exist since I just want to replicate the behavior of figures and tables, and List of Figures and List of Tables.


title: Conditionally hidden slides in beamer

text: When creating a presentation, I sometimes create extra slides that contain additional information, a more thorough explanation, or an extra plot pertaining to certain parts of my talk. These extra slides are usually in a separate PDF and the document is usually only opened if an audience member asks a question or requests information and one of my extra slides supplements my response nicely. I am wondering if it's possible to insert these slides into my presentation with the two following options:   1. The extra slides are skipped when progressing through the presentation _unless_...   2. I click on a hyperlink placed somewhere on the slide. If clicked, we traverse to the extra slide. From this slide, continuing to the 'next' slide would send us back to the slide that got us here originally. The above can be accomplished with two (or more) PDFs (one with the presentation, one -- or more -- with the supplemental slides) via `hyperref` but ideally I would like to only have one document. I am not familiar enough with `ifthen` to know if it can be done with that package. Any help would be much appreciated.


title: How to create a newcommand with knitr?

text: I am using `knitr` and I'd like to make some new commands to combine common tasks into one, e.g. `\newcommand{\numps}[1]{\numprint{\Sexpr{#1}}}` so that I can do something like `\numps{pi}`. I can't seem to get it to compile though. I'd get the following error: `mwe.tex:7: Package numprint Error: empty argument.` What can I fix this? Thanks. An MWE is as follows:               \documentclass{article}     \usepackage{Sweave}     \usepackage{numprint}     \newcommand{\numpS}[1]{\numprint{\Sexpr{#1}}}     \begin{document}          \numpS{pi}          \end{document}


title: Subcaption package error, even without the use of the subfigure package

text: I have read countless instructions on how to use the subcaption package, and tried several examples. Each time I get two types of errors, which I will post further down. This is my premable:               \documentclass[12pt, a4paper, oneside]{Thesis} % Paper size, default font size and one-    sided paper     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[american]{babel}     \usepackage{csquotes}     \DeclareUnicodeCharacter{00A0}{~}     \graphicspath{{./Figures/}} % Specifies the directory where pictures are stored     \usepackage[backend=bibtex, natbib, style=authoryear,maxbibnames=9, doi=false,    url=true, isbn=false]{biblatex}     \DeclareLanguageMapping{american}{american-apa}     \DefineBibliographyStrings{norsk}{bibliography = {References},}     \usepackage{hyperref}     \usepackage{pgfplots}     \pgfplotsset{compat=1.9}     \usepackage{float}     \usepackage{mdwlist}     \usepackage{chngcntr}     \usepackage{paralist}     \usepackage{soul}     \usepackage{caption}     \usepackage{subcaption}     \newcommand{\Qline}[1]{\noindent\rule{#1}{0.6pt}}      This is the current caption code:               \begin{figure}         \centering         \begin{subfigure}[b]{0.3\textwidth}                 \includegraphics[width=\textwidth]{E:/Masteroppgaven/TeXhis/Figures/QuickRight}                 \caption{Original Prototype}                 \label{fig:QRight}         \end{subfigure}%         ~          \begin{subfigure}[b]{0.3\textwidth}                 \includegraphics[width=\textwidth]{E:/Masteroppgaven/TeXhis/Figures/QuickLeft}                 \caption{Second Iteration}                 \label{fig:QLeft}         \end{subfigure}         \caption{Quick Selection}\label{fig:QSelect}     \end{figure}      Finally, these are the error messages that I am given.               C:\Program Files (x86)\MiKTeX 2.9\tex\latex\caption\subcaption.sty:48:      Package subcaption Error: This package can't be used in cooperation [\endinput}{}]          E:\Masteroppgaven\TeXhis\Chapters\UseOfTheNovelDesignPrinciples.tex:28:      Missing number, treated as zero. [\begin{subfigure}[b]{0.3\textwidth}]          E:\Masteroppgaven\TeXhis\Chapters\UseOfTheNovelDesignPrinciples.tex:28:      Illegal unit of measure (pt inserted). [\begin{subfigure}[b]{0.3\textwidth}]      Does anyone have any idea of how I can solve this issue? The reason I added the preamble is that most other people have stated that the subcaption package can't be used together with the subfigure package, but as you can see I do not add it to my Thesis.tex


title: Redefining enumerate counters in beamer

text: I'd like to do two things with the `enumerate` environment in `beamer`.   1. I'd like to reformat it so that it shows up as              (1) An item       a. A subitem       b. Another subitem        2. I'd like to be able to refer to these items with the usual `\ref` tags. Unfortunately, the only way I've found of getting the display of items inside of the environment right doesn't deliver the correct result for the references. Here's a minimal working example.               \documentclass{beamer}          \setbeamertemplate{enumerate item}{(\insertenumlabel)}     \setbeamertemplate{enumerate subitem}{\alph{enumii}.}          \begin{document}          \begin{enumerate}     \item Foo\label{item:1}       \begin{enumerate}       \item Bar\label{item:2}       \item Zip\label{item:3}       \end{enumerate}     \end{enumerate}          Reference to ``Foo'': (\ref{item:1}).          Reference to ``bar'': (\ref{item:2}).           Reference to ``zip'': (\ref{item:3}).     \end{document}      Unfortunately, that results in all three references in arabic numbers, i.e., `(1)`, `(1)`, and `(2)` for the three `\ref`'s, in that order. The desired output is for `(\ref{item:3})` to be rendered as `(1b)`.


title: Consistent placement for page number with changing margins

text: I have a document (letter paper) with a cover letter, some single column pages and some two-column pages. For readability I would like to use 1.5" margins for the single column pages and 1" margins for the two-column pages. I've done this using the `geometry` package and `\newgeometry`. However, when I compile the document the pages numbers (centered) move up and down, higher with larger margins and lower with smaller margins. Here is a MWE:               \documentclass[10pt, letterpaper]{article}      \usepackage{geometry}      \geometry{letterpaper, margin=1.5in, marginparsep=7pt, marginparwidth=.6in}     \usepackage{multicol}          \begin{document}     hi          \newgeometry{margin=1in}       \newpage     \begin{multicols}{2}     hello     \end{multicols}          \end{document}      I was wondering how I can keep the page number in a consistent position? **but** , I was also wondering what I **should** do, should I avoid these changing margins altogether? Should I leave it with the page numbers different on different pages? I've tried:               \usepackage{fancyhdr}     \fancyhf{} % clear all header and footers     \renewcommand{\headrulewidth}{0pt} % remove the header rule     \cfoot{\thepage}     \pagestyle{fancy}      and calling `\fancyhfoffset[E,O]{0pt}` after each `\newgeometry` call but I figure something else must be needed to have the page number not move.


title: algorithm2e comment style

text: I wanted to know how to change the comment style in the algorithm2e package. I want to make my comments of a smaller font and a different color:               \documentclass{article}          \usepackage{color}     \usepackage[linesnumbered,ruled,vlined]{algorithm2e}          \begin{document}          \begin{algorithm}[H]     \DontPrintSemicolon     \CommentSty{\color{blue}}       \KwData{Training set $x$}       $\Delta_{ji}^l := 0$ \tcp*{will be used to compute $\partial x$}       \tcc{iterate over all training examples}     \caption{Example code}     \end{algorithm}          \end{document}


title: Insert image within the Exercise package

text: I am writing an exam using `\usepackage{exercise}`. I have been using this package for some time with great results. However, this time, I would like to insert a small image on the right side of the exercise's questions. I've been trying several options, and finally settled for the `minipage` environment, since it is mentioned to work fine in the doc of the `exercise` package. But I get the following unintended result ![not really 2 columns here](http://i.stack.imgur.com/GBx54.jpg) If I replace the image with text, things work fine : I do get the 2 intended columns. Here is a mwe               \documentclass{article}     \usepackage{exercise}     \usepackage{graphicx}      \begin{document}     \begin{minipage}[t]{.7\textwidth}      \begin{Exercise}[label=ex6, origin={1.5 points}]     \Question This is question 1.     \vspace{1cm}     \Question This is question 2.     \vspace{1cm}     \Question This is question 3.     \vspace{1cm}     \end{Exercise}     \end{minipage}     \begin{minipage}[t]{.3\textwidth}      \centering      \includegraphics[width=\textwidth]{dyn.jpg}     \end{minipage}     \end{document}      The `\vspace` is to allow some space for the student to write the answer.


title: My .tex file was replaced by a blank file

text: I was writing a document with latex using Texworks, suddenly it stopped working. I forced the Texworks to terminate and started again, still the same. Finally I have restarted my computer and then tried again. This time .tex file is empty, all the contents have gone . Is there a way to recover my file? Thanks in advance!!


title: restatables and \listoftheorem

text: I am using the `restatable` environment from the `thm-restate` package of`thmtools`. I am also using `\listoftheorems` command to give me a list of the theorems. However, my restatable theorem is appearing twice in the list of theorems, even when I used the starred version. My feeling is that it should only be in the list of theorems once. Here is a mwe:               \documentclass{article}     \usepackage{thmtools}      \usepackage{thm-restate}          \declaretheorem[name=Theorem,numberwithin=section]{thm}          \begin{document}          \listoftheorems[ignoreall,show={thm}]          \section{First}          \begin{restatable}[Goldbach's conjecture]{thm}{goldbach}     \label{thm:goldbach}     Every even integer greater than 2 can be expressed as the sum of two primes.     \end{restatable}          \begin{thm}     Some other theorem     \end{thm}          Lets look at the first one again     \goldbach*          \end{document}       I've tried using the `ignoreall` key and to show just `thm` environments, but I guess the restatable is a `thm` too so this doesn't work. Any ideas appreciated, thanks!


title: babel: "No hyphenation patterns were loaded for the language 'Portuguese'"

text: I put in the preamble of my document:               \usepackage[brazil]{babel}     \usepackage[latin1]{inputenc}      When I compile as a PDF, I receive the output:               "No hyphenation patterns were loaded for(babel)     the language 'Portuguese'(babel)     I will use the patterns loaded for \language=0 instead"      What am I doing wrong? My main LaTeX editor is Kile.


title: The option vlined with algorithm

text: Please i ask if it's possible to add the option:               [vlined]       withe the package               \usepackage{algorithm}      \usepackage{algorithmic}      This is my example:                \usepackage{algorithm}      \usepackage{algorithmic}      \begin{document}      \begin{algorithm}[H]      \caption{My algo}      \begin{algorithmic}[1]      \WHILE{condition}      \STATE instruction 1      \STATE instruction 2      \ENDWHILE      \end{algorithmic}      \end{algorithm}      \end{document}      i'd like to join while to \ENDWHILE with a line, is that possible ?


title: Change text background within paragraph (with automatic linebreaks)

text: How do I change the text color as well as the text background color for e.g. a sentence within a paragraph? I know \textcolor for coloring the font and \colorbox for background coloring [http://en.wikibooks.org/wiki/LaTeX/Colors]. Unfortunately \colorbox will not perform a linebreak. Is there any solution for that? I want to make MY changes in a PDF document visible for review. I know some other approaches like diffpdf, oder pdftotext and then diff.. But I thought this should be an easy task. Thanks for your comments. Edit: Hm, appetite comes with eating: Unfortunately the \hl command from soul and all other approaches I saw does not regard whole environments like itemize, tabular. So I don't want to highlight all text inside them separately. Do you see any way around this problem? Thanks again.


title: Control column width with left alignment in tabular

text: I want to make a table with a bigger than default column width for the first column. The text in this column should be left aligned. Here is my code.               \begin{tabular}{llll|l}     Address1    &&&& Mobile: 888-000-0000 \\     Address2    &&&& Fax: 888-000-0000 \\     \end{tabular}      The first column (Address1, Address2) should have a larger width so that the second column (Mobile, Fax) is close to the right margin of the page. Now I just add in a lot of invisible columns so that there are more spaces between them. I wonder if there is a way to control the width of the first column.


title: figure, errors '\undefined control sequence - \ltx@Ifundefined{....'

text: Please help me tell why the following code is not correct?               \documentclass[a4paper,12pt]{article}     \usepackage{graphicx}     \begin{document}     \begin{figure}[htp]     \centering     \includegraphics[width=100mm]{lls.eps}     \hfill     \includegraphics[width=100mm]{AIC.eps}\\     \hfill     \includegraphics[width=100mm]{BIC.eps}\\     \end{figure}     \end{document}       or other code:               \documentclass[a4paper,12pt]{article}     \usepackage{graphicx}     %\usepackage{subfig}     \begin{document}     \begin{figure}       \centering       \label{figur}\caption{equation...}       \begin{tabular}{cp{2cm}c}         \includegraphics[width=60mm]{1.eps}& & \includegraphics[width=60mm]{lls.eps}\\         & & &\\         \includegraphics[width=60mm]{2.eps}& & \includegraphics[width=60mm]{AIC.eps}\\         & & &\\         \includegraphics[width=60mm]{3.eps}& & \includegraphics[width=60mm]{BIC.eps}\\       \end{tabular}     \end{figure}     \end{document}


title: Using Beamer, condensed outertheme with proper colors

text: I am condensing a few of my talks in Beamer. The theme I like creates an enormous header when I have many sections                \usetheme{Malmoe}      \usecolortheme[named=Brown]{structure}       ![exampleofmanysections](http://i.stack.imgur.com/Hayyw.png) I like the CambridgeUS theme, but I can't get the Brown color scheme when I try something like this               \usetheme{CambridgeUS}     \usecolortheme[named=Brown]{structure}       the red colors from Cambridge override my selection. Is there an easy way to have this color theme with a header that looks like this?               [ section ]      [ subsection ]     (white on black) (white on brown)


title: Force stringification of a length

text: I'm trying to include a background image of the correct size based on the two variables `\IApaperheight` and `\IApaperwidth`. To do this, I'm converting the lengths to a rounded text value and concatenating them with a prefix in another variable. I can render the full path correctly, but when I try to pass it to `\includegraphics` it is complaining because (as far as I can figure out) the path isn't a string, but instead a bunch of macros. Is there any way I can "stringify" the path name so that I can use it as a literal? I am using this to convert lengths to rounded integers:               % \IArndmm{\length} returns the length in mm rounded to an integer     \makeatletter%     \def\l@nunitperpt{0.351459}\def\l@nunits{mm}%     \def\@round#1.#2\@empty{#1}%     \newcommand{\IArndmm}[1]{%         \setlength{\@tempdimc}{\l@nunitperpt #1}%           \addtolength{\@tempdimc}{0.5pt}%         \edef\@@round{\strip@pt\@tempdimc}%         \expandafter\@round\@@round.\@empty%     }%     \makeatother%     %      Then this to include the image:               \newcommand{\IABGImageName}[3]{#1/#2x#3.jpg}%     %     \includegraphics[         width=\IApaperwidth,height=\IApaperheight,keepaspectratio]{%             \IABGImageName{\IABGImage}%                       {\IArndmm{\IApaperwidth}}%                       {\IArndmm{\IApaperheight}}%     }}%


title: Removing \chairman in MIT LaTeX thesis template

text: I am using the MIT LaTeX thesis templates as a template. On the `cover.tex` page I've tried commenting out / removing the `\chairman` command. `%\chairman{Arthur C. Smith}{Chairman, Department Committee on Graduate Theses}` but this leads to an unexpected error:               line 91: Undefined control sequence \maketitle     line 91: There's no line here to end. \maketitle     line 91: Undefined control sequence \maketitle      What is the root cause of this behavior? It looks to me like somehow some commands (eg. `\thesisdate`, `\degreeyear` etc. are required by this template.


title: Is pdflatex a one pass compiler?

text: I was wondering why `pdflatex` displays some references in the text as question marks the first time that the file is compiled? For instance, with bibliographies at the end of an article that are referenced in the text that is the case - the first time I compile the document, I get questionmarks instead of numbers that point to respective entries. The second time it's fine. Does this mean that `pdflatex` goes through the document only once?


title: Parbox as an initial

text: Similar to my last question Initial with wrapfigure -- other idea? I would like to create a wrapped environment in which I can take a `\parbox` or `minipage` environment. The following code shows the idea solved with `wrapfigure`:               \newcommand{\definition}[1]{     \settowidth{\test}{#1}     \begin{wrapfigure}[3]{l}{1.2\test}     \begin{minipage}[c][3\baselineskip][c]{1.2\test}     \centering%     {}#1{}     \end{minipage}     \end{wrapfigure}\par     }      The `lettrine` package, which was offered by Gonzalo Medina in the answer of my above mentioned question shows an attractive solution. What I want is just a `\parbox` or a `minipage` environment at the place of the initial. Some idea? Edit: After I tested the code of Ulrike I set the parbox inner position from bottom to center. The following pdf schould show my concrete idea. (And I will to apologise to be so complicated :-)) ![The mathematical formula schould be at the same height as the line at the right side](http://i.stack.imgur.com/eeHkT.png) The red line illustrates that the baseline of the formula should be at the same heigth as the textline right to it. The grey bars show that there should be more space to be. That's all :)


title: Charclass/Interchartokes for Umlauts and „“

text: How can I define a charclass for umlauts, german quotes `„“` (and other special characters which are not A–Z/a–z)?   I’d like to use this for extra kerning in some cases.               \documentclass{minimal}     \XeTeXinterchartokenstate=1          % char class for W     \newXeTeXintercharclass \mycharclassW     \XeTeXcharclass `\W \mycharclassW     % char class for german ä (a umlaut)     \newXeTeXintercharclass \mycharclassae     \XeTeXcharclass `a \mycharclassae     % char class for german opening quote „     \newXeTeXintercharclass \mycharclassOQ     % charclass for german closing quote “     \newXeTeXintercharclass \mycharclassCQ          % def interchartokes     \XeTeXinterchartoks \mycharclassW \mycharclassae = {\kern0.5pt}          \begin{document}     Wa\quad Wä\quad „W“     \end{document}      How can I add more than one char to a new class, e.g., making C, O, U and Q available in one class (`\mycharclassCOQU`)?


title: TikZ: Execute code at end of scope OR picture and access its bounding box

text: TikZ provides the two keys `execute at end picture={<code>}` and `execute at end scope={<code>}` which can be used to execute any code at the end of the picture and of the current `scope`, respectively. I now like to execute some code at the end of the picture if a TikZ key defined by me is used outside a `scope` environment, i.e. in the optional argument of `tikzpicture` or at the end of the scope if it is used inside the `scope`, i.e. in its optional argument. I also like to access the bounding box of that area, i.e. the complete one or only the one of the scope, respectively. Is there am easy way to do this? Cascaded scopes should also be supported. I don't see a possibility to detect if I'm inside a scope or not. In theory the whole `tikzpicture` is a scope by itself and `execute at end scope` seems to work but the manual explicitly states it should only be used in the optional argument of a `scope` environment. I know about 'local bounding box' but then I would have to use it for every scope with a different name to avoid collisions.


title: Line numbers in pseudocode in figures - using lineno in figures

text: can someone show an example how to obtain line numbers in the alltt environment **in figures** , possibly using the lineno package? I've tried:               \begin{figure}[h]     \begin{alltt}     {\linenumbers     def insert(k, v)       // ... pseudocode     }     \end{alltt}     \caption{Basic operations I}     \end{figure}      but that, or using the `linenumbers` environment, doesn't do anything. The code above doesn't work even if the `alltt` environment is removed - there are no line numbers if the text is within a figure. Is there any way to obtain line numbering in figures? Thank you.


title: How can I design a book cover?

text: Can anyone share his or her experience on designing a book cover? I just finished writing my "Awk One-Liners Explained" e-book and now I am designing the cover. I tried `\maketitle` and the result was pretty ugly (see screenshot below). I'd appreciate any tips on designing book covers. ![bad looking book cover](http://i.stack.imgur.com/f5Z9L.png)


title: Labeling rectangle above rectangle.

text: This is perhaps a simple question, but after reading manual several times, I still don't have the answer. My common situation is that I draw boxes and I want label above/below the box. If I use node[above] or node[anchor=south], the label is just above center of the box. Situation gets even more absurd if rectangle is slanted. Is there any simple way to achieve my goal? Regards, Marko.               \documentclass[12pt,a4paper]{article}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}     \draw (0,0) rectangle node[above] {$m$} +(2,1);     \draw (0,2) rectangle node[anchor=south] {$m$} +(2,1);          \begin{scope}[xshift=4cm,rotate=-30]       \draw (0,0) rectangle node[above] {$m$} +(2,1);       \draw (0,2) rectangle node[anchor=south] {$m$} +(2,1);     \end{scope}     \end{tikzpicture}          \end{document}


title: A macro that expands to the length of its argument

text: If I want to anonymise a paper I've written for review, I don't just want to delete my name from the author field. I want to replace my name with a rule as tall as a capital letter and as long as my name would be. This way, it looks like my name is being censored out of history. (I don't really do this...) Here's an MWE:               \documentclass[12pt]{article}     \usepackage{lipsum}     \newlength\namelength     \settowidth\namelength{Seamus Bradley}     \title{A paper with no author}     \author{\rule{\namelength}{12pt}}     \begin{document}     \maketitle     \lipsum     \end{document}      Now here's the question. How would I define a `\lengthof` macro that looks at its argument and then expands to that length? Since you can't put a `\settowidth` inside a `\rule` (or it didn't work when I tried it), this isn't as trivial as I thought... Is there a way to do this? Or a good reason why there isn't a good way to do this?


title: How do I insert a command using braces into the caption of a ctable?

text: I need to place a hyperref command into the caption of a ctable, but this does not produce correct output. For example:               \ctable[caption={Properties of the \hyperref[sec:Towers]{Towers} dataset.}, label=table:TowersData, doinside=\footnotesize]{lll}{}{%     1&2&3\\     }      produces a table with caption "Towers" and on the next line "dataset.]Properties of the Towers dataset." I assume the problem is with the braces in the hyperref statement, but I need them for it to work properly. Is there another way to include a hyperref in the caption while still using ctable? Perhaps a way to prevent the nested braces from being seen by ctable?


title: How to add a horizontal line above the footer with fancyhdr?

text: How to add a horizontal line above the footer using `fancyhdr`, just like the line present below the header?


title: Problem with Multicolumn and Multirow table

text: I have a problem in my multirow and multicolumn table. As you can see in the figure, there is an extra horizontal line over the first column. Can anybody tell me how to remove it. I constructed the entire table with the help of articles given in Latex WikiBooks. This is my code:               \documentclass[letterpaper, 10 pt, conference]{ieeeconf}       \IEEEoverridecommandlockouts                                   \overrideIEEEmargins           \usepackage{multirow}          \begin{document}          \maketitle     \thispagestyle{empty}     \pagestyle{empty}     %-----------------------------------------------%     \begin{table}[!t]   \label{table:accuracy}     \centering     \caption{Title.}     \begin{tabular}{| c | c | c | c | c |} \cline{1-4}          & \multicolumn{3}{ c| }{A} \\     \hline           \multicolumn{1}{|p{1cm}|}{\centering A= \\ $[B,C]$} & \multirow{2}{*}{C} & \multirow{2} {*}{D} & \multicolumn{1}{|p{1.5cm}|}{\centering E+ \\ F} & \multicolumn{1}{|p{1.8cm}|} {\centering G+\\+H+I}  \\       \hline \hline      $[4,1]$        &    30.22\%  &   46.67\%  &  44.27\%  &  30.48\%   \\     $[4,2]$      &    76.94\%  &   73.27\%  &  80.03\%  &  38.47\%   \\              $[4,3]$      &    55.22\%  &   68.75\%  &  71.66\%  &  57.29\%   \\              $[4,4]$      &    98.98\%  &   79.52\%  &  82.59\%  &  21.84\%   \\     $[5,2]$      &    36.94\%  &   56.48\%  &  63.25\%  &  47.40\%   \\          $[5,3]$      &    63.99\%  &   53.30\%  &  51.70\%  &  59.32\%   \\              $[5,4]$      &    46.46\%  &   39.06\%  &  39.94\%  &  59.91\%   \\              $[6,4]$      &    96.80\%  &   96.80\%  &  100\%    &  98.17\%     \\     \hline     \multicolumn{1}{|p{1cm}|}{\centering R \\ S}  &  \multirow{2}{*}{56.37\%} &  \multirow{2}{*}{58.33\%} &  \multirow{2}{*}{\textbf{60.15\%}}  &  \multirow{2}{*}{\textbf{51.76\%}} \\          \hline     \end{tabular}     \end{table}          \end{document}      The top figure shows how it is currently, and how I would like it to be: ![enter image description here](http://i.stack.imgur.com/PEJZE.png)


title: Tabs versus spaces for indenting TeX documents

text: The title tells it all. What is a "correct" way to indent TeX documents? Different programming languages have different conventions. Python recommends 4 spaces. Your Makefile will not even work if you do not use tab for indenting. Generally normalized (Allman style) BSD C code is indented with tabs of width 8. Being an OpenBSD user I tend to use tab (set to 8 characters) to indent all my code including TeX except Python. However due to the fact that I use NVI with displayed line numbers the effective width of my terminal is only 72 characters which, coupled with 8 character indentation, makes some of my TeX documents difficult to read. On another hand quick look at my               /usr/local/share/texmf-dist/tex/latex      directory reveals that LaTeX style files are indented with two spaces. Is that true in general? Should I use the same convention for LaTeX documents too?


title: listings bug: space after quote collapsed when inlined with spaceflexible/fullflexible columns

text: > **Possible Duplicate:**   >  listings bug: space after literate replacement lost with > spaceflexible/fullflexible columns I seem to have stumbled upon a minor bug in listings (version 1.4 as of 2007/02/22). A space following a quotation mark (`'`) is being collapsed in spaceflexible and fullflexible mode when using `\lstinline`, even though it appears properly rendered within `lstlstings` environment. Same problem occurs with double quotation mark (`"`), and problem persists with use of upquote. Problem appears to have something to do with detection of language strings, as it goes away if `language={}`. Here is a minimal example demonstrating the problem. Note well that the space is lost immediately within the string literal, as well as the space just after the string literal but before the following `+` sign.               \documentclass{article}     \usepackage{listings}     \lstset{language=C, columns=fullflexible, showstringspaces=false}          \begin{document}          \noindent     \begin{tabular}{ll}     flexible & \lstinline[columns=flexible]!' A ' + ' B '!\\     spaceflexible & \lstinline[columns=spaceflexible]!' A ' + ' B '!\\     fullflexible & \lstinline!' A ' + ' B '!\\     \end{tabular}          \bigskip     \noindent     Within lstlisting environment with columns=flexible     \begin{lstlisting}[columns=flexible]     ' A ' + ' B '     \end{lstlisting}          \noindent     Within lstlisting environment with columns=spaceflexible     \begin{lstlisting}[columns=spaceflexible]     ' A ' + ' B '     \end{lstlisting}          \noindent     Within lstlisting environment with columns=fullflexible     \begin{lstlisting}     ' A ' + ' B '     \end{lstlisting}          \end{document}      * * * ![demonstration](http://i.stack.imgur.com/7OQaz.png) * * * I'd be interested to know if anyone else has experienced this, and if there is any patch that addresses the problem.


title: marking conditional versions with line in margin

text: I have two versions of a document, which I have implemented using the `versions` package. So I can use `\includeversion`/`\excludeversion` to generate the different versions from the same source. I would like to generate a single document, in which the conditional material is neither included nor excluded, but _marked_. The versions package provides the `\markversion` command and the hooks `\beginmarkversion` and `\endmarkversion` for this purpose. I want my marks to be a vertical line that runs in the margin along the entire conditional material. Here is my implementation so far. I know this is probably an abuse of TikZ, but it's the only way I know how to begin:               \documentclass{article}     \usepackage{lipsum}     \usepackage{tikz}     \usepackage{versions}     % customize the marks of beginning and ending version     \makeatletter     %% TikZ style       \newcounter{versionmark}       \renewcommand{\beginmarkversion}{%         \stepcounter{versionmark}%         \begin{tikzpicture}[overlay, remember picture]           \node[coordinate] (bv\theversionmark) at ([xshift=2cm]0,0 -| current page.south west) {};         \end{tikzpicture}%       }       \renewcommand{\endmarkversion}{%         \edef\theversion{\@currenvir}         \begin{tikzpicture}[overlay, remember picture]           \node[coordinate] (ev\theversionmark) at ([xshift=2cm]0,0 -| current page.south west) {};           \draw[red!80!black]              (ev\theversionmark)              -- (bv\theversionmark) node[midway,sloped,anchor=south] {\theversion};           \draw[red!80!black]             (ev\theversionmark) --++ (1ex,0cm)             (bv\theversionmark) --++ (1ex,0cm);         \end{tikzpicture}%         }     \makeatother     \markversion{A}     \markversion{B}     %\includeversion{A}     %\excludeversion{B}          \begin{document}               \begin{A}     \lipsum[1]     \end{A}          \begin{B}     \lipsum[2]     \end{B}          \begin{A}     \lipsum     \end{A}               \end{document}      This works in the first two cases, but not in the third because the conditional material is longer than a page. When the second `\end{A}` is found, the line begins not at the point of the second `\begin{A}`, but the point on the page of `\end{A}` that's in the same position as `\begin{A}` is on its page: ![sample page 1](http://i.stack.imgur.com/8FWtb.png) ![sample page 2](http://i.stack.imgur.com/RgFYP.png) How can I fix this so the line starts at the beginning of the conditional material and ends at the end of it?


title: commath, \dfrac and \tfrac

text: I'm using the `commath` package for its nice `\od` and `\pd` functions, but I find it uses `\tfrac` internally. It seems to have an 'if-then' clause to sometimes use `\dfrac` but it never does so in my tests:               test 1: \od{p}{x}\\     test 2: $\od{p}{x}$     test 3: \(\od{p}{x}\)      Or in `align` environments either. I don't see any options to control the package behavior. Should I just re-define `\od` and `\pd` in my preamble to behave the way I want?


title: Multi-layered table

text: I'm a bit stuck at the moment. I want a table like the following (quickly drawn in Word, and I don't want the vertical lines as displayed - I'm using booktabs). The reason I'm making such a table is to summarise the findings of the literature review, and I'm splitting the studies by category (e.g. colour or music). Also, I'd like the column widths of the 'citation' column to be ever slightly bigger than the 'sample' and 'environment' columns, but smaller than the 'conclusion' column, which should be the biggest Please note that the white text and black background is **not** the colour scheme I want. I'm not sure about the colour options in Latex, but a background colour that would work well with **black text** would be fine - perhaps a light gray? ![enter image description here](http://i.stack.imgur.com/dmMz4.png) I began writing something in latex (so it is _not_ a MWE) but I simply got stuck. I've included the packages of xcolor, because my googling revealed this how to fill in rows & columns, and I'm certain that my final table will span more than one page. Also would it be better if lines (of the same thickness) were between the "Colour" and "Music" 'sub-headings' ? Probably not.               \documentclass{article}     \usepackage{booktabs, xcolor, longtable}     \begin{document}     \begin{longtable}     \toprule     Citation & Sample & Environment & Conclusion     ...     ...     \end{longtable}     \end{document}


title: Is luatex as secure as pdftex?

text: My `texmf.cnf` file contains these lines:               % Allow TeX \openin, \openout, or \input on filenames starting with `.'     % (e.g., .rhosts) or outside the current tree (e.g., /etc/passwd)?     % a (any)        : any file can be opened.     % r (restricted) : disallow opening "dotfiles".     % p (paranoid)   : as `r' and disallow going to parent directories, and     %                  restrict absolute paths to be under $TEXMFOUTPUT.     openout_any = p     openin_any = a      But if I compile the following code via `lualatex`, the file `/home/login/unsafe.txt` is created!               \documentclass{article}     \usepackage{luatextra}     \begin{luacode*}       function securityproblem(a)         local file = assert(io.open(os.getenv("HOME") .. "/unsafe.txt", "w"))         file:write("foobar\n")         file:write(a)         file:close()       end     \end{luacode*}     \begin{document}     \directlua{securityproblem("\today")}     \end{document}      Is luatex as secure as pdftex? **Edit:** With the `--safer` option, `luatex` can't write files (via `io.open`) but `fontspec` (for example) is unusable. Is there a safe way to use LuaTEX with `fontspec` (and other useful features of LuaTeX) ?


title: Manual/automatic line breaks and text alignment in TikZ nodes

text: How can I insert a line break in a TikZ node? Simply putting `\\` where I want the break doesn't work (see MWE). Is there a way to make lines break automatically at some specified width? And can I control the alignment of the text (left, right, centered, justified)?               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \node {First line\\second line};     \end{tikzpicture}     \end{document}      ![](http://i.stack.imgur.com/g3qCL.png)


title: Tikz: Multi-line text in the node description

text: I use tikz to create pictures in latex. My picture consists of set of nodes. Every node has its own text inside the node, for example, "This node is valuable":                 \node (mynode) [mystyle,right=of anothernode] {This node is valuable};           When I compile the document I see the description as one line. **This node is valuable** Is it possible to split the line into multiple lines? Like this: **This node** **is** **valuable** Which commands should one apply in order to achieve this?


title: Tikzpicture: Line break in node label to right

text: How can I introduce a line break into the labels of the end nodes in the following MWE? The Tikzpicture will include the line breaks if I remove the `label=right:` part and just leave `label=' but that centers the label`above' the node, rather than to the right. How can I get the label to include the line breaks and also stay to the right of the end node?               \documentclass{article}          \usepackage[latin1]{inputenc}     \usepackage{tikz}     \usetikzlibrary{trees}     \begin{document}     \pagestyle{empty}               % Set the overall layout of the tree     \tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm]     \tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm]          % Define styles for bags and leafs     \tikzstyle{bag} = [text width=4em, text centered]     \tikzstyle{end} = [circle, minimum width=3pt,fill, inner sep=0pt]          % The sloped option gives rotated edge labels. Personally     % I find sloped labels a bit difficult to read. Remove the sloped options     % to get horizontal labels.      \begin{tikzpicture}[grow=right, sloped]     \hspace{-60pt}     \node(A)[bag] {$S(3)$ $(Bet~3)$}             child {                     node[bag] {$S(4)$ $Bet~4$}                                     child {node[end, label=right: {Some text \\ Some text \\ Some text }] {}                                     edge from parent node[below] {$Quit$} node[above]  {}                             }                             child {                                     node[end, label=right: {Some text \\ Some text \\ Some text }] {}                                     edge from parent node[above] {$Bid$} node[below]  {}                             }                             edge from parent node[below] {$LLL$} node[above]  {}             }             child {                     node[bag] {$S(4)$ $Bet~4$}                            child {                                     node[end, label=right: {Some text \\ Some text \\ Some text }] {}                                     edge from parent node[below] {$Quit$} node[above]  {}                             }                             child {                                     node[end, label=right:{Some text \\ Some text \\ Some text }] {}                                     edge from parent node[above] {$Bid$} node[below]  {}                             }                     edge from parent node[above] {$WWW$} node[below]  {}             };     \begin{scope}[]                    \end{scope}     \end{tikzpicture}          \vspace{60pt}                    \end{document}


title: Line breaks in TikZ nodes

text: I have this code that outputs a small family tree                   \documentclass{article}         \usepackage{tikz}         \usetikzlibrary{trees}         \begin{document}         \begin{tikzpicture}[           man/.style={rectangle,draw,fill=blue!20},           woman/.style={rectangle,draw,fill=red!20,rounded corners=.8ex},           grandchild/.style={grow=down,xshift=1em,anchor=west,             edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}},           first/.style={level distance=6ex},           second/.style={level distance=12ex},           third/.style={level distance=18ex},           level 1/.style={sibling distance=5em}]             % Parents             \coordinate               child[grow=left] {node[man,anchor=east]{Jim}}               child[grow=right] {node[woman,anchor=west]{Jane}}               child[grow=down,level distance=0ex]             [edge from parent fork down]             % Children and grandchildren             child{node[man] {Alfred}}             child{node[woman] {Berta}}             child {node[man] {Charles}}             child {node[woman]{Doris}};                 \end{tikzpicture}         \end{document}      and what I want to do, is to write 2 lines of text in each box (e.g. Jim and underneath his DOB). How do I break a line in order to do that? `\\` doesn't work. Here is a printscreen of the output: ![Screenshot](http://i.stack.imgur.com/IlcWG.png)


title: How can I use linebreak inside \coordinate, in tikz?

text: well I need to write some text right next to my shape. But it's too complicated when making it all coordinate i and write it. How I make it easier?


title: tikz align text to left inside node

text: I am trying to align node text to left but it seems below code still put the text at the center of node:               \documentclass{standalone}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}[thick]       \node[draw,rectangle,minimum width=10em,align=left] (A) {Abc};     \end{tikzpicture}          \end{document}      The output is: ![output](http://i.stack.imgur.com/xCqht.png) Update: Thanks for your valuable comments, so I should update it as following:               \documentclass{standalone}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}[thick]       \node[draw,rectangle,minimum height=4em,text width=10em,align=left] (A) {Abc};     \end{tikzpicture}          \end{document}      Then it's exactly what I want: ![enter image description here](http://i.stack.imgur.com/ouyBf.png)


title: How to get a line break in tikz label of the arrow?

text: This is my code:               \documentclass{article}     \usepackage{tikz}     \usepackage[margin=15mm]{geometry}     \usepackage{calc}     \usetikzlibrary{matrix,arrows}     \usetikzlibrary{positioning,arrows}     \usetikzlibrary{shapes,arrows,fit,calc,positioning,automata}          \newcommand{\mytab}[2]% alignment, content     {   \begin{tabular}{#1}             #2         \end{tabular}     }          \begin{document}          \tikzset{         mynode/.style={line width=0.25pt, draw, minimum width=3.0cm, minimum height=1.0cm, inner sep=0, anchor=south west},         mymatrix/.style={line width=0.5pt, draw, inner sep=0},         myline/.style={shorten <=0.2pt, shorten >=0.2pt},     }          \begin{figure}[H]     \begin{tikzpicture}         \matrix[matrix of nodes, nodes=mynode, mymatrix] (s1) at (0,-2)         {   $p_0$  \\             $f(q_0, x) = q_0$  \\         $g(q_0, x, y) = y$ \\         };               \matrix[matrix of nodes, nodes=mynode, mymatrix] (s2) at (7,-2)          {  $p_0$  \\             $f(q_0, x) = q_0$  \\         $g(q_0, x, y) = z1.y$ \\          };               \node [ below = 1 mm of s1,align=center] (a1) {$r_0$};          \node [ below = 1 mm of s2,align=center] (a2) {$r_1$};               \draw[-latex] (s1.120) to [out=135,in=45] node [auto] {$a \rightarrow [y = a.y]$\newline$b \rightarrow [y = b.y]$}  (s1.80);          \draw[-latex] (s1.east) to node [auto]                {$a \rightarrow [y = a.y]$\newline$b \rightarrow [y = b.y]$} (s2.west);          \end{tikzpicture}     \end{figure}          \end{document}      This is the output: ![enter image description here](http://i.stack.imgur.com/l10Mt.jpg) How to get line break on labels? And why are some lines of the node are appearing darker than others?


title: Curly Brace tikZ

text: Im trying to force Latex to do a \newline on the text of my curly brace, or it doesn't allow me and the result is the following: ![enter image description here](http://i.stack.imgur.com/ww0hr.png) As you see, there are some curly braces very close, so the texts overlap. I'd like to force a \newline, but it doesn't allow me! =( A code of one of my curly braces:                %Brace     \draw[decorate, decoration={brace, mirror}] let \p1=(pVI11.north), \p2=(pVI11.south) in     ($(-9.8, \y1+1.5em)$) -- ($(-9.8, \y2-1em)$)      node[at start, left=10pt, rotate=90] {Creation fichier \newline shape.tex};       Thanks 4 ur help! ^^ (and sorry 4 my english... ^^ )!Bye!Gemma


title: Breaking line inside tikz node

text: I have the following code. I cannot for the life of me find a way to lay the table _under_ the pink figure .. ![code reproduction](http://i.stack.imgur.com/xXPmJ.png)               \documentclass{article}          \usepackage[english]{babel}     \usepackage{tikz}     \usetikzlibrary{arrows,automata}     \usepackage{adjustbox}          \begin{document}          \begin{adjustbox}{center}     \begin{tikzpicture}[->, >=stealth', shorten >= 2pt, auto, node distance=8cm, thick]     \tikzstyle{every edge}=[draw=black,thick]     \tikzstyle{every state}=[fill=white, draw=black, thick, text=black, scale=1]     \node[state] (1) {\tikz \draw[->,very thick] (0,1) -- (1,0);};     \path (1) edge [loop left] node[left] {     \fbox{\scalebox{.5}{\tikz \filldraw[draw=red,fill=red!20] rectangle (3,3);}}     \\     \\     \begin{tabular}[b]{ll}     p: 78\%&\\[2ex]     $\mu$: -7\% & $\sigma$: 7\%\\     $\alpha$: 0.38 & N: 11977     \end{tabular}     } (1);     \end{tikzpicture}\end{adjustbox}          \end{document}      any help? thx ! :-)


title: TikZ - same label for every left/right edge

text: Is there a way to give every edge on the left the same label up to a specific level (I don't want labels on my leaf nodes). I want to build a Huffman-Code, so it would be nice to have every left edge labeled with a 0 and every right edge labeled with a 1. Is there a way to do this with options or automated? Here is my tree; it's rather big und will only fit onto an A4 landscape page:               \begin{tikzpicture}[every tree node/.style={draw,circle},         level distance=15mm,         sibling distance=8mm,         edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}]     \tikzset{frontier/.style={distance from root=90mm}}     \Tree     [ .205         \edge node[auto=right]{0};         [ .82             \edge node[auto=right]{0};             [ .40                 \edge node[auto=right]{0};                  [ .20                     \edge node[auto=right]{0};                      [ .10                         \edge node[auto=right]{0};                         [ .5 <nl> ]                         \edge node[auto=left]{1};                         [ .5 I  ]                     ]                     \edge node[auto=left]{1};                     [ .10 l ]                 ]                 \edge node[auto=left]{1};                 [ .20 t ]             ]             \edge node[auto=right]{0};             [ .42                 \edge node[auto=right]{0};                 [ .20                     \edge node[auto=right]{0};                     [ .10                         \edge node[auto=right]{0};                         [ .5 b ]                         \edge node[auto=left]{1};                         [ .5 d ]                     ]                     \edge node[auto=left]{1};                     [ .10 p ]                 ]                 \edge node[auto=left]{1};                 [ .22                     \edge node[auto=right]{0};                     [ .12                         \edge node[auto=right]{0};                         [ .5 k ]                         \edge node[auto=left]{1};                         [ .7 u  ]                     ]                     \edge node[auto=left]{1};                     [ .10 s ]                 ]             ]         ]         \edge node[auto=left]{1};         [ .123             \edge node[auto=right]{0};             [ .53                 \edge node[auto=right]{0};                 [ .24                     \edge node[auto=right]{0};                     [ .12 i ]                     \edge node[auto=left]{1};                     [ .12 o  ]                 ]                 \edge node[auto=left]{1};                 [ .29 l ]             ]             \edge node[auto=left]{0};             [ .70                 \edge node[auto=right]{0};                 [ .30                     \edge node[auto=right]{0};                     [ .15 a ]                     \edge node[auto=left]{1};                     [ .15 n ]                 ]                 \edge node[auto=left]{1};                 [ .40 <sp>  ]             ]         ]     ]     \end{tikzpicture}


title: Bar chart from CSV file with adjustable bar width

text: I have a CSV file with approximately 1500 records that I would like to plot using something like a bar chart, but I don't know where to start at all. Each record contains a width and a height, which needs to be translated into the width and height of the bars. The bars then need to be arranged side by side without space in between. The total accumulative width is about 50k units, and the maximum height is about 205k. The y-axis (height) should have a logarithmic scale, since most height values are <10k. I hope to scale the whole thing to about 1 x 0.75 * a page's available width. I also would like a scale on the x- and y-axes that is readably large when scaled. _CSV example:_               height,width     1,884     2,5768     3,835     7,2661     10,492     11,1349     ...


title: Sanitizing Text from Word Documents

text: When I collaborate with other individuals, I generally receive text to be typeset in the form of a word document. However, it seems that there are almost always characters that, when I copy and paste - for lack of a better word, "bugger up" pdflatex. Is there a way to _sanitize_ these special characters and replace them with their plain text cognates? `’` with `'`, double-spaces with space, and so on. Note: I could very well be referring to an issue associated with encoding, but I don't understand that - and neither will my collaborators. PS: No idea what tag is relevant here, so please do so appropriately should you have the ability to do so.


title: equations inside matrix/array -- aligning on charater

text: Suppose I have a system of equations I'd like to present as a vector. Using `amsmath`, something like               \begin{equation}     \begin{pmatrix}     (2)(2)+(-1)(-3)  \\     (4)(2)+(3)(-3)      \end{pmatrix}     \end{equation}      What I'd like to do is not simply 'center the equations' within the vector (easy enough), but have them center-aligned on the '+' sign. I've tried embedding `align` within `pmatrix`, but that doesn't seem to work. In the end, it isn't critical that the equations are presented within a formal 'matrix' structure -- I'd be satisfied with a 'large enough' left and right delimiter. Any suggestions welcomed.


title: Underbrace under table, stretching over multiple columns

text: I want to notate some information to table column groups, using underbraces. So there should be an `\underbrace` under the table, that stretches over multiple rows. I tried the following:               \begin{tabular}{r|c|c|c|c}       i & 0 & 1 & 2 & 3 \\       \multicolumn{1}{c}{} & \multicolumn{3}{c}{$\underbrace{\hfill}_{a_1}$} & \multicolumn{1}{c}{$\underbrace{\hfill}_{a_1}$}     \end{tabular}      The `\hfill` here doesn't work as I'd expect. The brace isn't stretched, but remains small and is centered. How can I make it stretch?


title: Overbrace over two columns of 3-column Table

text: I'm little new in LateX. What I want to achieve is to make overbrace over two columns in 3-columnt table. I mean that I don't want to make overbrace over whole neither one column. For now I got this:               \begin{tabular}{c | p{2cm} | c@{,} l}     \multicolumn{2}{c}{$overbrace{Col1 | Col2}$} & \multicolumn{2}{c}{Col3} \\     R1C1 & R1C2 & 1&24123     R2C1 & R2C2 & 12&3123     \end{tabular}      I think that solution could be simple but I can't get it. Have any ideas?


title: Reduce the height of a rectangle

text: I am drawing a rectangle which is split into 2 parts:               \documentclass[runningheads,orivec]{llncs}     \usepackage{tikz}     \usetikzlibrary{positioning,shapes,shadows,arrows}     \begin{document}     \tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=white!20, drop shadow,         text centered, anchor=north, text=black, text width=3cm, scale=0.8]     \begin{figure}[H]       \centering       \begin{tikzpicture}[node distance=1cm,]         \node(domain) [abstract, rectangle split, rectangle split parts=2, text width=7cm, text height = 0.1cm, text justified]         {           \begin{center}hehe\end{center}           \nodepart{second}haha         };       \end{tikzpicture}     \end{figure}     \end{document}      There is just "hehe" in the first part, but the height is too much... `text height = 0.1cm` does not seem to work... Does anyone know how to reduce the height of the first part, let it adjusted in according to the text?


title: Vertical space before list environment within a macro

text: _**UPDATE_** My problem comes down to the following: vertical space is added before the `\item`s of a list within a macro. The layout I want to use is based on the classicthesis-styled CV (currvita) template by Alessandro Plasmati and the defined commands (`\MarginText` and `\Description`) should produce a margin text that is aligned vertically with the first line of the `\Description` text. However, when using lists, vertical space is added before the list. How can I suppress this? I already tried `\setlength{topskip}{0pt}` and also the space controls added by the `enumitem` package. Why do lists behave like this? **MWE:**               \documentclass[a4paper]{scrartcl}     \reversemarginpar     \newcommand{\MarginText}[1]{\marginpar{\raggedleft#1}}     \newcommand{\Description}[1]{#1}          \begin{document}     \Description{\MarginText{Papers}     \begin{itemize}     \item a bibitem     \item another one     \end{itemize}     }          \end{document}      ![enter image description here](http://i.stack.imgur.com/KpL3O.png) * * * _Old Version_ When I use `\bibentry` in the classicthesis-styled CV, the entries are listed after a line break, however I want the `\bibentry` _next_ to the category (e.g. papers, conferences, posters etc.). Also, the bibliography gets listed below (which I don't want)—how can I change this? See an example in the uploaded screenshot and the MWE below. ![enter image description here](http://i.stack.imgur.com/Fpzu7.png) > **MWE**               %----------------------------------------------------------------------------------------     %   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS     %----------------------------------------------------------------------------------------          \documentclass[a4paper]{scrartcl}     \usepackage[nochapters]{classicthesis}      \usepackage[LabelsAligned]{currvita}           %***********************     % FONTS     %***********************     \usepackage{fontspec,xunicode}     \setmainfont[Ligatures={Common,Historical}]{Adobe Caslon Pro}     \setsansfont[Mapping=tex-text,Scale=MatchLowercase]{Futura}               %***********************     % LAYOUT     %***********************     \reversemarginpar % Move the margin to the left of the page      \newcommand{\MarginText}[1]{\marginpar{\raggedleft\itshape\small#1}\marginparsep0pt} % New command defining the margin text style          \usepackage{xcolor}\renewcommand{\cvheadingfont}{\Huge\sf{\bf}\color{Maroon}}           \usepackage{hyperref}          \newlength{\datebox}\settowidth{\datebox}{Long  2011} % Set the width of the date box in each block          \newcommand{\NewEntry}[3]{\noindent\hangindent=2em\hangafter=0 \parbox{\datebox}{\small \sffamily \textit{#1}}\hspace{1em} #2 #3 % Define a command for each new block - change spacing and font sizes here: #1 is the left margin, #2 is the italic date field and #3 is the position/employer/location field     \vspace{0.5em}} % Add some white space after each new entry          \newcommand{\Description}[1]{\hangindent=2em\hangafter=0\noindent\raggedright\footnotesize{#1}\par\normalsize\vspace{1em}} % Define a command for descriptions of each entry - change spacing and font sizes here                         % bib stuff     \usepackage[round]{natbib}     \usepackage{bibentry}     \nobibliography*               %----------------------------------------------------------------------------------------                                   \begin{document}          \thispagestyle{empty} % Stop the page count at the bottom of the first page          %----------------------------------------------------------------------------------------     %   NAME AND CONTACT INFORMATION SECTION     %----------------------------------------------------------------------------------------          \begin{cv}{\spacedallcaps{The Applicant}}\vspace{1.5em} % Your name          \noindent\spacedlowsmallcaps{Personal Information}\vspace{0.5em} % Personal information heading          \NewEntry{*}{\textit{Born in the USA,}}{19 July 2013} % Birthplace and date           \NewEntry{email}{\href{mailto:me@post.com}{me@post.com}}% Email address          \NewEntry{address}{Ice cream street 3, 0188484 Popsicle, Alaska} % Personal website          \NewEntry{phone}{(H) +33 (0) 3455 9222\ \ $\cdotp$\ \ (M) +33 (0) 455 1116661} % Phone number(s)          \vspace{1em} % Extra white space between the personal information section and goal          \noindent\spacedlowsmallcaps{Goal}\vspace{1em} % Goal heading, could be used for a quotation or short profile instead          \vspace{2em} % Goal text          %----------------------------------------------------------------------------------------     %   EDUCATION     %----------------------------------------------------------------------------------------          \spacedlowsmallcaps{Education}\vspace{1em}               \NewEntry{2009--2013}{University XYZ}          \Description{\MarginText{Ph.\,D.} Info, info, info\ \ $\cdotp$\ \ School: School of Physics \newline Thesis: \textit{"Title title"} Description: ... \\ Advisors: Dr.\,XC \textsc{Hellloo}}          %----------------------------------------------------------------------------------------     %   PUBLICATIONS     %----------------------------------------------------------------------------------------          \spacedlowsmallcaps{Publications}\vspace{1em}          \Description{\MarginText{Papers}     \begin{itemize}     \item \bibentry{Bohr:1923tl}     \item \bibentry{Bohr:1923tl}       \end{itemize}     }          \Description{\MarginText{Posters}     Text text text     \begin{itemize}     \item \bibentry{Bohr:1923tl}     \item \bibentry{Bohr:1923tl}       \end{itemize}     }          \Description{\MarginText{Conferences}     \bibentry{Bohr:1923tl}     }          %------------------------------------------------          \end{cv}          %\nocite{*}      \bibliographystyle{plainnat}      \bibliography{lib-x}          \end{document}      > **lib-x.bib**               @article{Bohr:1923tl,     author = {Bohr, N},     title = {{The structure of the atom}},     journal = {Nature},     year = {1923},     volume = {112},     pages = {29--44}     }


title: How can I check if a header has an ending full stop?

text: I am modifiyng some macros to enforce a section style that should end with a full stop. The full stop is added automatically, but sometimes people add the full stop and I get two. How can I modify the code to detect the punctuation and add it only if it is needed? I guess I need to use futurelet, but I don't know how to use it.


title: Indentation of the signature in the letter class

text: I am writing a letter with the wikibooks template. The letter is going to be printed on a official paper which contains the address already. So I thought I can omit the `\address` command. For some strange reason the signature will not indent as shown on the webpage. I tried the `\longindentation=20pt` command, no matter what numbers I change, the closing and the signature are all aligned to the left margin of the body and will not indent. I was able to get it work by the command `\address{\phantom{a}}`, but that should not be how it is supposed to work (yes, I did try `\address{}`, but that doesn't work). Any better solutions? What is wrong with omitting the `\address` command anyway? Edit: Here is the what I am doing.               ----------------------------------------------------------------------------------     \documentclass[11pt]{letter}          \signature{James Bond}     %\address{\phantom{i}}     %\longindentation=0pt     \begin{document}     \begin{letter}{}          \opening{To whom it may concern:}          The body of the letter goes on here.           \closing{Yours sincerely,}          \end{letter}          \end{document}     ------------------------------------------------------------------------------      As it stands now, without the address command, the closing and signature will not indent. However, if we uncomment the `\address` command, then they indents as shown in the Wikibook LaTeX example.


title: How to temporarily change equation numbering depth?

text: I have numbers like `(1.2.2.3)`, how do I get numbers like `(1.2.2.3)'` and `(1.2.2.3.1)`?


title: Citation appears as question mark, bibliography has title but is blank

text: I'm using the harvard package with BibTeX and not sure why it's coming up with question mark in pdf. Due to citation not working, reference is blank. Seen many people saying run BibTeX then LaTeX twice but this doesn't work at all. bib file should be fine as it's come straight from a journal site. My code is probably wrong..here's what I've got:               \documentclass{article}     \usepackage{mathtools}     \usepackage[top=3cm, bottom=3cm, left=4cm, right=2cm]{geometry}     \usepackage{bibentry}     \usepackage{bibtexlogo}     \usepackage{harvard}     \bibliographystyle{dcu}     \usepackage{cite}          \begin{document}          mortar’s properties.\cite{2003427682262} make reference...     etc. etc.          \bibliographystyle{dcu}     \bibliography{lanas}               \end{document}


title: Problems Customizing TOC in amsbook style

text: I am attempting to create a table of contents (in the `amsbook` document class) with a specific format; however, after several attempts I can't seem to get it to work out. The document will include several articles written by different authors (much like a typical Proceedings of Such-and-Such Conference book) The format I would like to see is: > Chapter Title A .................................................... Page #   >  Author   >  Long Chapter Title that wraps around   >  to the next line .................................................... Page > #   >  Author _The "author " lines should be indented some - I don't know how to indent on this forum.._ etc. The important points are that I need `\chapter*{}`, so that there are no chapter numbers, the page numbers should be aligned with each chapter title, with no additional page number on the "author" line, and the wrapped text for the long chapter title lines up with the beginning of title on the above line (every attempt I've made thus far indents the wrapped text, as if there are chapter numbers preceeding it- I dont want that). Sorry if this is trivially easy, but I'm not terribly experienced with customizing the table of contents, and I can't seem to get it to work at all.


title: Multicol: why do columns not align properly?

text: The following code does not align the contents of the two columns do not align properly; in particular, the content of the left column is a bit lower on the page than the content of the right column.               \documentclass [11pt]{article}     \usepackage{amsmath}     \usepackage{multicol}          \begin{document}     \noindent     So why do the two colums not align vertically?     \begin{multicols}{2}     \begin{align*}     & \text{\underline{function} } f_a(x): \\     & \quad \text{\underline{begin}} \\     & \quad \quad i \leftarrow 1; \\     & \quad \quad \text{\underline{while}} (g(i) \neq x) \text{ \underline{do} }         i \leftarrow i +1; \\     & \quad \quad f_a \leftarrow 0; \\     & \quad \text{\underline{end}}     \end{align*}     \begin{align*}     & \text{\underline{function} } f_a(x): \\     & \quad \text{\underline{begin}} \\     & \quad \quad i \leftarrow 1; \\     & \quad \quad \text{\underline{while}} (g(i) \neq x) \text{ \underline{do} }     i \leftarrow i +1; \\     & \quad \quad f_a \leftarrow 0; \\     & \quad \text{\underline{end}}     \end{align*}     \end{multicols}     \end{document}      Why? And how can I fix this? Note: I tried using `\Columnbreak`, to no avail. Curiously, if I add a blank line between the two `align*` environments, the content of the right column is a bit lower than the one on the left...


title: How to align description item labels on the right?

text: I have seen description-list-with-right-alignment-of-labels that explains, how to align description labels on the right. However the presented solution sets the lengths globally whereas I look for a local solution, meaning to specify the width for each environment separately. Is there a way telling each description environment what the broadest item is:               \documentclass{article}     \usepackage{enumitem}     \SetLabelAlign{parright}{\parbox[t]{\labelwidth}{\raggedleft#1}}          \setlist[description]{style=multiline,topsep=10pt,leftmargin=5cm,font=\textbf,align=parright}          \begin{document}          \begin{description}     \item[aaa] some text     \item[bbbbbb] some more text     \item[ccccccccc] and some text     \end{description}               \begin{description}     \item[aaaaaaa] some text     \item[bbbbbbbbbbbbbbb] some more text     \item[ccccccccccccccccccccccc] and some text     \end{description}          \end{document}


title: How can I prevent the next paragraph from overwriting the image of a description label?

text: LaTeX code generated from MarkDown by Pandoc:               \documentclass{article}     \usepackage{mwe}          \makeatletter     \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth     \else\Gin@nat@width\fi}     \makeatother     \let\Oldincludegraphics\includegraphics     \renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}          \setlength{\parindent}{0pt}          % begin custom preamble     \usepackage{enumitem}     \setlist[description]{style=multiline, leftmargin=4.2cm}          \renewcommand{\descriptionlabel}[1]{%         \begin{minipage}[t]{4cm}         \vspace{-\fontcharht\font`(}#1         \end{minipage}     }     % end custom preamble          \begin{document}     \begin{description}     \itemsep1pt\parskip0pt\parsep0pt     \item[\includegraphics{example-image}]     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis     sem. Nullam nec mi et neque pharetra sollicitudin.     \end{description}          \blindtext     \end{document}      Results in: ![next paragraph overlaps with description label image](http://i.stack.imgur.com/SjzVf.png) ## Question I would like to have automatic vertical separation with the next paragraph, **only by changing the preamble** , not the main document. (Remember, it is code automatically generated by **Pandoc**!)


title: Enlarge graphic axis

text: I have a function ploted with pgfplots:               \documentclass{standalone}     \usepackage{pgfplots}     \usepackage{helvet}     \usepackage{sansmath}     \begin{document}     \begin{tikzpicture}     \begin{axis}[          xlabel=$X$,         ylabel=$Y$,         axis x line=center,         axis y line=center,         grid,         grid style={green},         major tick style={draw=black, thick},         xticklabels={,,},         yticklabels={,,},         xmin=-5,         xmax=5,         ymin=-5,         ymax=5,         xtick={-5,-4,...,5},         ytick={-5,-4,...,5},         axis line style={thick},         samples=250,         unit vector ratio*=1 1,         tick label style = {font=\sansmath\sffamily},         every axis label = {font=\sansmath\sffamily},         legend style = {font=\sansmath\sffamily},         label style = {font=\sansmath\sffamily},         ]              \addplot [ultra thick, red]{42/27 *((x*x*x)/3 - (x*x)/2 - 2*x) +59/27} node [pos=0.75,left,black,{font=\sansmath\sffamily}] {$f(x)$};              \draw[very thick, blue] (axis cs: -2.5,4)--(axis cs: 0.5,4);         \draw[very thick, blue] (axis cs: 3.5,-3)--(axis cs: 0.5,-3);         \node[above] at (axis cs: -1,4) {\sffamily\textit P};         \node[below] at (axis cs: 2,-3) {\sffamily\textit Q};          \end{axis};     \end{tikzpicture}     \end{document}      The graphic generated by that code is the first one. The second one is the one that I want to achieve. Then, I want to do severals changes that can be seen in both graphics:   * Enlarge axis to put "X" and "Y" outside the grid, _without_ putting a tick in `x = −6` and `y = −6`. (I mean, I want to get the axis of the second figure, but not to finish the X axis in the left part by: "`|---`", but yes by "`---`"... and the same to the Y axis).   * Only put labels in `x = 1` and in `y = 1`.   * (If it's possible) Remove of the `font=\sansmath\sffamily` of the `f(x)` node and include it in the axis options to affect to all nodes.   * (If it's possible). Isn't there any other method to indicate tangent lines in points like P or Q, instead of doing it manually in TikZ as I did? ![Graphics](http://i.stack.imgur.com/nPp5Q.png)


title: How to add leaders to Table of Contents without tocloft?

text: I'm using a third-party non-standard document class which is based on `book`. Class be damned, I want to add dot leaders for chapters, sections and subsections in the Table of Contents. If I include `tocloft`, it changes the layout of the Table of Contents in undesirable ways. It also seems that the `tocstyle` package is for switching high-level styles, etc. So I would like to add dot leaders without radically changing the layout of the ToC. Does anyone know how this might be acheived? I also looked into the `titletoc` package which doesn't change the original ToC layout. However, the only way I could find to add a leader would be to use the following:                \titlecontents{<section>}[<left>]{<above>}{<before with label>}{<before without label>}{<filler and page>}[<after>]      I could just insert `leader` into the filler option, but I would have to redefine the entire style of the ToC to achieve this. I'm embarrassed to say I've been at this about an hour (LaTeX humbles you sometimes I guess). All answers I've found through Google just say to use `tocloft`. Wondering if anyone has a better idea?


title: Biblatex: How to suppress same author of multiple citations?

text: I need to use the features of biblatex's `verbose` citestyle but I don't want it to repeat the author's name in multiple citations by the same author (like the `authortitle-comp` option). Currently, using the `citestyle=verbose` option, if I cite three works by "An Author" as:               \autocites{ANAuthor:1}{ANAuthor:2}{ANAuthor:3}       the output is: `"A. N. Author. 'First work' etc [full entry]; A. N. Author. 'Second work' etc [full entry]; A. N. Author. 'Third work' etc [full entry]."` But I need to have the output: `"A. N. Author. 'First work' etc [full entry]; 'Second work' etc [full entry]; 'Third work' etc [full entry]."` Is there any way to do this in the `verbose` style? That is, suppress the author field in multiple citations for subsequent works by the same author? Grateful for any assistance! * * * _Update clarification_ The only way to achieve this, I think, is to make a custom `biblatex` `citestyle`. Looking at the `verbose.cbx` the relevant command is the the printing of the `bibhypertarget`, as in the commands for full and short citations: > >        \newbibmacro*{cite:full}{%   >             printtext[bibhypertarget]{%   >             \usedriver   >               {\DeclareNameAlias{sortname}{default}}   >               {\thefield{entrytype}}}%   >           \usebibmacro{shorthandintro}} >   >        \newbibmacro*{cite:short}{%   >           \printnames{labelname}%   >           \setunit*{\addcomma\space}%   >           \printtext[bibhyperlink]{%   >             \printfield[citetitle]{labeltitle}}}   >   Does anyone know how to modify that to print the author field as blank when the same author appears previously in the same multicites command?


title: apa6: hyperref fails to recognize \subsubsection

text: I recently experienced several issues after some packages got updated. The one remaining is that `hyperref` doesn't recognize `\subsubsection{}` anymore when using the `apa6` class. The bookmarks in the PDF output are displayed as `<Untitled>`. The same is true for the example provided in the `apa6` documentation. I added a minimal example that also produces the erroneous bookmarks. All the other referencing (citations, etc.) seems to work just fine.               \documentclass[jou]{apa6}          \usepackage{hyperref}          \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[style=apa,sortcites=true,sorting=nyt]{biblatex}     \DeclareLanguageMapping{american}{american-apa}     \addbibresource{bibliography.bib}          \title{Sample}     \author{Author}     \affiliation{University}     \leftheader{Author}     \abstract{This is a test abstract.}     \keywords{APA6}          \begin{document}     \maketitle     \section{Method}     \subsection{Materials}     Several materials were used for this project. Some of them were     \subsubsection{Paper-and-Pencil Instrument}     We used an instrument that we found to be highly successful.     \printbibliography     \end{document}


title: biblatex: is it possible to combine two styles?

text: Ok so after my first question yesterday Clickable, bottom page reference ?! Possible ? and based on the received answer I decided to head for `biblatex`, install biber and all. But the documentation is tough : I found the german tutorial but except Dancke shön I don't know what to say/do. Ok so my question is simple. I loaded `enter code here`biblatex this way               \RequirePackage[backend=biber,style=chem-acs,sorting=none,hyperref]{biblatex}      And the American Chemical Society style is perfect (well almost what I'm looking for). Now this option loading verbose               \RequirePackage[backend=biber,style=verbose-trad1,sorting=none,hyperref]{biblatex}      allows me to have footnote citations as I wished! But I would like to have footnote citations with op cit ibid. etc ... and the ACS format (or whateever else format.)


title: Can I get the list of all letter/digit/other characters inside LaTeX?

text: I'm searching for a command which is (almost) the inverse of `\catcode`. Is there a command to print all the characters of a character group? Use-case: disable linebreaking of listings at all but one character of the "other" group using the `alsoletter` option. Something like this.               \lstset{alsoletter={\charother{}}}      I would like to drop one character from the list using `\StrSubstitute` from the `xstring` package.


title: Hyphenating a verse range

text: I am typesetting verses using `bibleref` and sometimes verse ranges get cut in the end of lines. For example, in: Jean 3.16-18 the cut might happen right after the "-" (which is actually typeset as `--`). Do you think it is proper for such ranges to be cut, or should this be prevented? Specifically, if you know French typography, is there a rule that says that such cuts should be prevented? The manual from the French _Imprimerie Nationale_ does specify that numbers (such as `5,25%` or `11h30`) should not be cut, but it doesn't talk about ranges. **Disclaimer:** I know this question is more about typography (and I'm looking forward to the typography SE site), but I can't think of another good place to ask this right now.


title: Compile a LaTeX document into a PNG image that's as short as possible

text: I need to convert my LaTeX documents into PNG. The problem is, I also need the resulting image to be as short as possible (height-wise). I've tried `latex` followed by `dvipng`, but the result is always the size of a page. For instance, take a `.tex` file containing:               \documentclass{article}       \begin{document}       Hello. This is a test.     \begin{equation}       L = 2                                                                          \end{equation}       \end{document}      If I compile it with `latex`, and then run `dvipng`, I get a PNG file that's the size of a full page. What I need is for the PNG file to be only as tall as needed for everything to fit. So the image would end immediately after the equation. The image still needs to have full width (because of the equation numbering). Is there a way to achieve that?


title: How can I get tex file compiled into image

text: > **Possible Duplicate:**   >  Compile a LaTeX document into a PNG image that's as short as possible What is the easiest way to compile tex file into image (I mean in any common graphic formats JPG/PNG/...)? Is there something easier then compiling into PS and transferring it into image?


title: Strikeout in math mode

text: How can I strikeout words in math mode (similar to `\sout` with `\usepackage{ulem}` in text mode)? I've tried `\usepackage{cancel}` and `\(\cancel{1+1=2}\)` but that draws a diagonal line.


title: Problem with mathastext package

text: The following very simple code does not work here:               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Droid Sans}     \usepackage[italic]{mathastext}          \begin{document}        \section{test}            test $\frac{1}{2}$     \end{document}      The problem seems to be with the `mathastext` package, when I load it I get the following error: > >     LaTeX Error: Command `\mathdollar' already defined. >   It happens with any font, it's not related to the use of Droid Sans. What am I doing wrong?


title: Is there a trick to reduce the number of counters in the following case?

text: I want to avoid using `\tmp`. Is it possible to remove it while keeping the same output? ![enter image description here](http://i.stack.imgur.com/LN8xy.png)               % Declare counters.     \newcount\pages% \pages is given so you cannot remove it!     \newcount\x     \newcount\tmp          % Initializing.     \pages=9% Try it for an odd or even integer.     \tmp=\pages     \advance\tmp by 1     \x=1          \loop         \ifnum\x<\tmp         \noindent\hfill\the\x         \advance\x by 1         \ifnum\x>\pages             \hfill\null\endgraf         \else             \hfill\the\x\hfill\null\endgraf         \fi         \advance\x by 1     \repeat          \bye      Note: Please don't use `e-TeX` extension as I am learning Knuth's original TeX right now.


title: Latex style that resembles the one used in some computer science books

text: I would like to find a latex style that is close to the one used in books like the followings:   * Melvin Fitting, "First-Order Logic and Automated Theorem Proving" http://books.google.es/books?id=nYN0dBrCpmMC&pg=PA9   * Li and Vitányi, "An Introduction to Kolmogorov Complexity and Its Applications" http://books.google.es/books?id=25fue3UYDN0C&pg=PA259   * The CC-licensed book "Mathematics for Computer Science" available at http://courses.csail.mit.edu/6.042/spring12/mcs.pdf Does anybody know a similar layout format?


title: XeTeX + polyglossia: Trying to get greek text in PDF bookmarks

text: Although I've googled extensively to find a solution, most of the related information online is about `babel`. I'm working with `polyglossia` and can't get the pdf bookmarks to appear in greek, although I have `unicode` set for `hyperref`, I've tried the `bookmark` package and several other suggestions online. Example:               \documentclass{book}          \usepackage{polyglossia}     \newfontfamily\greekfont[Script=Greek]{Liberation Serif}     \newfontfamily\greekfontsf[Script=Greek]{Liberation Sans}     \setdefaultlanguage[variant=sans]{greek}          \usepackage[bookmarks=true,bookmarksopen=true,                 bookmarksopenlevel=0,bookmarksnumbered=true,unicode]{hyperref}          \begin{document}          \chapter{Συμπεράσματα}     Συμπεράσματα          \end{document}


title: TikZ: showing a plane moving in 3 space

text: I have 2 identical planes a distance of `\Delta t` apart. I want to show that first plane is being pushed in the direction of the second plane. I was thinking maybe some randomly placed arrows tangent to the planes pointing from plane one to plane two. >   1. Would this be the way to go? >   2. How can I set up a `\foreach` command and specify 5 random arrows > starting in the area of the plane? That is, not passing through the first > plane just touching it and moving away tangent to the plane. > Or is there a better way to show this?               \documentclass[convert = false, tikz]{standalone}          \usepackage[utf8]{inputenc}     \renewcommand{\rmdefault}{ppl}     \linespread{1.05}     \usepackage[scaled]{helvet}     \usepackage{courier}     \usepackage{eulervm}     \normalfont     \usepackage[T1]{fontenc}     \usepackage{textcomp}          \usepackage{amsmath}     \usepackage{tikz-3dplot}          \begin{document}     \tdplotsetmaincoords{60}{130}     \begin{tikzpicture}[tdplot_main_coords]       \coordinate (O) at (0, 0, 0);            \draw[-latex] (O) -- (5, 0, 0) node[font = \small, pos = 1.1] {\(x\)};       \draw[-latex] (O) -- (0, 5, 0) node[font = \small, pos = 1.1] {\(y\)};       \draw[-latex] (O) -- (0, 0, 4) node[font = \small, pos = 1.1] {\(z\)};       \draw[dashed] (O) -- (-3, 0, 0);            \filldraw[blue, opacity = .6] (4, 0, 0) -- (4, 5, 0) -- (4, 5, 4) --       (4, 0, 4) -- cycle;       \filldraw[blue, opacity = .6] (-2, 0, 0) -- (-2, 5, 0) -- (-2, 5, 4) --       (-2, 0, 4) -- cycle;            \draw[latex-latex] (4, 5, 2) -- (-2, 5, 2) node[font = \small, fill = white,       inner sep = 0, pos = .5] {\(\Delta t\)};       \draw[|-|] (4, 2.5, 4) -- (-2, 2.5, 4) node[font = \small, fill = white,       inner sep = 0, pos = .5] {\(v\Delta t\)};     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/RiWWR.png)


title: Align Captions of 2 figures

text: I managed to get my two Tikz figures side by side. The vertical alignment of the Tikz figures is fine and needs to stay that way. However, I am bothered by the captions and I'd like both of them to be at the bottom.                 \begin{figure}[!ht]       \minipage{0.5\textwidth}       \centering     \begin{tikzpicture}       % Styles       \tikzstyle{main}=[minimum size=5mm, very thick, draw=black!100]       \tikzstyle{bolt}=[circle]       \tikzstyle{connect}=[-latex, thick]       % Bolts       \node[main,bolt] (s)   at (0.0, 0.0) [label=above:Bolt S] { };       \node[main,bolt] (t)   at (1.5, 0.0) [label=above:Bolt T] { };       % lines       \draw (s) edge [connect] (t);     \end{tikzpicture}     \caption{Cap 1}       \endminipage\hfill       \minipage{0.5\textwidth}       \centering     \begin{tikzpicture}[remember picture]       % Styles       \tikzstyle{main}=[minimum size=5mm, very thick, draw=black!100]       \tikzstyle{bolt}=[circle]       \tikzstyle{connect}=[-latex, thick]       % Bolt S       \node[main,rounded corners=10pt] (S) [label=above:Bolt S] {         \begin{tikzpicture}           \node [main,bolt] (ai) at (0.0, 1.5) {};           \node [main,bolt] (aii) at (0.0, 0.0) {};         \end{tikzpicture}       };       % Bolt T       \node[main,rounded corners=10pt,right=of S] (T) [label=above:Bolt T] {         \begin{tikzpicture}           \node [main,bolt] (bi) at (0.0, 3.0) {};           \node [main,bolt] (bii) at (0.0, 1.5) {};           \node [main,bolt] (biii) at (0.0, 0.0) {};         \end{tikzpicture}       };       % Connect       \draw (S) edge [connect] (T);     \end{tikzpicture}     \caption{Cap 2}       \endminipage       \end{figure}      It currently looks like this: ![enter image description here](http://i.stack.imgur.com/t1PQL.png) Cheers!


title: Makeindex: Bibleref–Eledmac-Incompatibility?

text: If I compile the following tex-document makeindex produces wrong index entries (always the last line of the page is referenced). What's the reason for it and is there a way to solve this?               \documentclass{memoir}     \usepackage{eledmac}     \usepackage{bibleref}     \makeindex[bibel]     \renewcommand{\biblerefindex}{\edindex[bibel]}     \begin{document}     \beginnumbering     \pstart     Lorem ipsum dolor sit amet, \edtext{consectetuer}{\Bfootnote{\ibibleverse{Gen}(1:1)}} adipiscing elit. Etiam     lobortis facilisis sem. Nullam nec mi et neque pharetra     sollicitudin. \edtext{Praesent}{\Afootnote{Present \textit{A}}} imperdiet mi nec ante. Donec ullamcorper,     felis non sodales commodo, lectus velit ultrices augue, a     dignissim nibh lectus placerat pede. Vivamus nunc nunc, molestie     ut, ultricies vel, semper in, velit. Ut porttitor. Praesent in     sapien. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.     Duis fringilla tristique neque. Sed interdum libero ut metus.     Pellentesque placerat. Nam rutrum augue a leo. Morbi sed elit sit     amet ante lobortis sollicitudin. Praesent blandit blandit mauris.     Praesent lectus tellus, aliquet aliquam, luctus a, egestas a,     turpis. Mauris lacinia lorem sit \edtext{amet}{\Bfootnote{\ibibleverse{Dan}(5:1)}} ipsum. Nunc quis urna dictum     turpis accumsan semper.     \pend     \pstart     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam     lobortis facilisis sem. Nullam nec mi et neque pharetra     sollicitudin. Praesent imperdiet mi nec ante. Donec ullamcorper,     felis non sodales commodo, lectus velit ultrices augue, a     dignissim nibh lectus placerat pede. Vivamus nunc nunc, molestie     ut, ultricies vel, semper in, velit. Ut porttitor. Praesent in     sapien. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.     Duis fringilla tristique \edtext{neque}{\Bfootnote{\ibibleverse{Mt}(12:1)}}.      \pend     \endnumbering     \printindex[bibel]     \end{document}      I'm using:   * memoir.cls 2013/05/22 v3.7 configurable book, report, article document cla ss   * eledmac.sty 2013/04/15 v1.4.6 LaTeX port of EDMAC   * bibleref.sty 2011/01/19 1.14 (NLCT)


title: Caption below lstinputlisting in multicols + redefining lstlisting caption format

text: I have 2 problems with `caption` for `lstlisting`.   1. I can't get the `caption` of `lstlisting` to go below the list when it's in a `multicols` environment. Although I've added `\captionsetup[lstlisting]{position=bottom}` to the document preamble, nothing changes.   2. Furthermore, in my documents I generally use a modified `caption` style which is defined as follows: `\DeclareCaptionFormat{myformat}{#1#2#3\hrulefill}` To give me a horizontal line underneath the caption. I would like to add this `hrulefill` to the `caption` of `lstlisting` to make all captions uniform in my documents. I'd be very grateful for all help I can get! The minimal working example is below, together with a pdf of the output. Thank you.               \documentclass[utf8,12pt,letterpaper]{article}     \usepackage{setspace}     \usepackage{fontspec}     \usepackage{caption}     \captionsetup[lstlisting]{position=bottom}     \usepackage{multicol}     \usepackage{listings}     \begin{document}     \begin{multicols}{6}[\captionof{lstlisting}{The first 100 lemmata}]     \begin{lstlisting}     a     aback     abacus     abandon     abase     abashed     abate     \end{lstlisting}     \end{multicols}     \end{document}      ![enter image description here](http://i.stack.imgur.com/h9fAh.png)


title: Incorrect reference to a line in algorithmic using hyperref

text: I am using `algpseudocode` and `algorithm` packages to typeset pseudocode. I also use `float`, `hyperref` and `caption` packages. The problem is that when I reference a line in the pseudocode, the number is correct, but when I click it, the document moves to the beginning of the chapter and not the algorithm. Minimal example:               \documentclass{book}     \usepackage{blindtext}     \usepackage{float}     \usepackage{hyperref}     \usepackage[hypcap]{caption}     \usepackage{algpseudocode}     \usepackage[chapter]{algorithm}          \begin{document}     \chapter{Heading}     Reference to the line \ref{line}.     \Blindtext     \begin{algorithm}     \begin{algorithmic}[1]         \State Statement \label{line}     \end{algorithmic}     \caption{Example}     \label{alg}     \end{algorithm}     \Blindtext     \end{document}


title: Xubuntu 12.04 + Tex Live 2012 no biblatex binary and no biber

text: I am getting really confused now. I installed Tex Live 2012 on my Xubuntu 12.04 with a backport and I installed TexMaker. I could user PdfLatex right away and it generated everything I needed except my bibliography. I read that Tex Live 2012 comes with biblatex so I just changed the bibtex command in TexMaker from "bibtex" to "biblatex". However, that does not exist. So I did               sudo apt-get remove biblatex     sudo apt-get install biblatex      The package is installed but I don't find the binary. Using bibtex the whole thing crashes. Which does not surprise me since I want to userbiber:               \usepackage[backend=biber]{biblatex}      Btw does biber come with biblatex? So far I couldn't get any clear explanation what biber and biblatex are to each other. **EDIT:** I had to remove texlive completely and install it with the install script form http://www.tug.org/texlive/quickinstall.html. Apparently the newest version of biber does not work with the older version of biblatex I had.


title: Positioning node at end of line

text: The following code fails to do what I want:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes.geometric,calc}     \begin{document}     \tikz{%     \draw (0,0) -- (\textwidth, 0) node[draw, inner sep=5pt,at start, anchor=north] (A)  {\large\textbf{\textsf{Example}}};     }     \end{document}      ![enter image description here](http://i.stack.imgur.com/Y5MQh.png) The problem is that the node's left most rectangular border is not being position at the start of the line. As it is only the middle of the node is being placed at the beginning of the line. Any insights?


title: minted: How to pass LaTeX commands via \newminted and how to use different styles?

text: I would like to use `minted` to redefine the Sweave environments `Sinput` and `Soutput` (see the example below). This way, I can have `minted` format my `R` code. There are two problems left: 1) Is it possible to pass other commands (such as `\par` or `\vspace`) to `Sinput` and `Soutput` via minted? As you can see, I tried it for `Soutput` but it failed. It would be great to be able to pass commands/arguments, since that would allow one to adjust the spacing between the `Sinput` and `Soutput` environments. Note: this works with `listings`'s `lstnewenvironment`. 2) Is it possible to use different minted highlighting styles (e.g., `emacs` and `bw`) for `Sinput` and `Soutput` defined below? This way, the input and output could be colorized differently which would be very nice. Note: this works with `listings`'s `\lstset` command which can be used to adjust style- related settings.               \documentclass{scrartcl}          \usepackage[T1]{fontenc}     \usepackage[american]{babel}     \usepackage{xcolor}     \usepackage{fancyvrb}     \usepackage{Sweave}     \usepackage{minted}          \xdefinecolor{lightgray}{RGB}{247, 247, 247}     \xdefinecolor{semilightgray}{RGB}{235, 235, 235}          \renewenvironment{Schunk}{\par\vspace{0.3\baselineskip}}{\\[-0.5\baselineskip]}          \expandafter\let\csname Sinput\endcsname\relax     \expandafter\let\csname endSinput\endcsname\relax     \expandafter\let\csname Soutput\endcsname\relax     \expandafter\let\csname endSoutput\endcsname\relax     \expandafter\let\csname Sinput*\endcsname\relax     \expandafter\let\csname endSinput*\endcsname\relax     \expandafter\let\csname Soutput*\endcsname\relax     \expandafter\let\csname endSoutput*\endcsname\relax          \usemintedstyle{emacs}          % redefine Sweave's Sinput     \newminted[Sinput]{r}{%       linenos,% line numbers       bgcolor=semilightgray% background color     }     % redefine Sweave's Soutput     \newminted[Soutput]{r}{%       bgcolor=lightgray% background color     %  \protect\vspace{\baselineskip}     }          \begin{document}     <<label=preliminaries, echo=FALSE, results=hide>>=     options(width=74, useFancyQuotes="UTF-8", prompt="> ", continue="  ")     options(SweaveHooks=list(fig=function() par(mar=c(4, 4, 0.4, 0.7))))     @     Just before the Schunk, to see the spacing.     <<foo>>=     (x <- rnorm(20))     3!=4     @     Just after the Schunk, to see the spacing.     \end{document}