title: Bold \hlines for longtable

text: I've searched the topic and found the following two answers. **Answer 1.** LaTeX tables: How do I make bold horizontal lines (typically `\hline`)? The best answer suggests to use `booktabs`. However `booktabs` documentation says: > A somewhat technical note: within a `longtable`, `\hline` and `\hline\hline` > both produce a double rule (to allow for page breaks occurring at that > point). But the `booktabs` rules do not. Longtable’s automatic doubling of > `\hline` is questionable, even according to the documentation within that > package. But doubled `booktabs` rules make almost no sense at all. **In the > unfortunate event that a`booktabs` rule should occur at a page break, then > you will have to make the necessary adjustments by hand.** (In general, this > will mean deleting the oﬀending rule.) That's not the way it works. I don't want to make any more adjustments by hand since there are already a lot of things to be checked over. **Answer 2.** Longtable does not break correctly when used with `\specialrule` instead of `\hline` Here the author have faced the problem described above. He'd tried to use `\specialrule` from the `booktabs` package but the output at page break was buggy. The solution was to use normal `\hline` with previously adjusted `\arrayrulewidth`. Unfortunately, this can be applied only to the whole longtable, but not to the individual `\hline`.


title: Undefined Control Sequence ...entrycounter[]{page}\glsnumberformat{33}}}

text: I recently switched from MikTex to TexLive. At first, the document I had begun with miktex build just fine. But now I'm getting the error below: > File: Document.gls > > Type: error > > line 15: \setentrycounter[]{page}\glsnumberformat{33}}}\glsgroupskip > > Undefined control sequence ...entrycounter[]{page}\glsnumberformat{33}}} It seems to be some trouble with a glossary entry. Unfortunately, I have not been able to reproduce the error in a test-document. Does anybody have an idea what could be causing this?


title: How to code the german "ß" in Latex

text: I've read lots tutorials how to code "ß" in Latex. Unfortunately none of them could help me. Here is my code:               \documentclass[11pt]{amsart}     \usepackage{geometry}                     \geometry{letterpaper}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{epstopdf}     \usepackage[encoding]{inputenc}          \begin{document}     daß     \end{document}      For `encoding` I have tried so far: `latin1`, `latin9`, `utf8`, `applemac`. All of them crashed with "undefined control sequence". I'm using TeXShop on MacOSX 10.6. TeXShop itself uses `utf8` encoding. I've checked that. So, how do I get "ß" WITHOUT typing `{\ss}`?


title: Short titles, Journal abbreviations, etc. in biblatex

text: I've been making the switch toward using `biblatex-chicago` to replace an old `.bst` (now out-dated), but I'm still confused as to how `biblatex` handles short-forms and abbreviations. For example, when I cite an article from the journal _Vetus Testamentum_ , I want the footnote to use the abbreviation _VT_ , but the bibliography to use the full form. In my old `.bst` file I used the .bib field `shortjournal`, but that doesn't seem to be the way `biblatex` works. Similarly, I would like to be able to abbreviate commonly cited reference works, e.g. _Ancient Near Eastern Texts_ as _ANET_ in my footnotes, and use it's full form in the bibliography. I'm guessing that this functionality is built into `biblatex`, I just don't know how to use it.


title: Google Books BibTeX export

text: Is Google Books a reliable source of BiBTeX records? I've found a negative feedback back from 2008, and not sure it is sill valid. Unlike Lead2Amazon and Tungare's ISBN to BibTeX converter, Google Books relatively well understands Unicode and replaces it with control sequences. But are there factual errors in records?


title: titlesec \clearpage before a part

text: I'm using the `titlesec` package for my sectioning. I want to have a `\clearpage` before every `\part` however when I put it into the `format` field of               \titleformat{command}[shape]{format}{label}{sep}{before-code}{after-code}      Then it does what I want, but if the very first part of the document (which is incidentally the first content after the `\maketitle` command, it will insert a blank page. This is because, to quote the titlesec documentation, > `{format}` is the format to be applied to the whole title—label and text. > This part can contain vertical material (and horizontal with some shapes) > which is typeset just after the space above the title Note the ''just after the space above the title'. So `\clearpage` should not be put into the `format` field. I can do the same thing that I want to do, but with sections, not parts, using               \newcommand{\sectionbreak}{\clearpage}      I know there are other commands just like that for things such as `subsubsection` or `subsection`, but I couldn't find one for `part` that worked. How would I do it?               \documentclass{article}          \usepackage{titlesec}          \titleformat{\part}[display]{\clearpage\itshape\rmfamily\raggedright}{\LARGE Part     \thepart}{0mm}{\Huge}{}     \titlespacing*{\part}{0mm}{30mm}{30mm}          \begin{document}     \part{Part test}     test text     \end{document}


title: How to exclude text portions by simply setting a variable or option?

text: I'm writing a document where some text portions are confidential and would therefore like to create an environment (e.g. `confidential`) which I can then exclude from the PDF by simply setting a variable or option. Is there any way of doing this in LaTeX, or better yet, is there a package for this?


title: Reset custom counter in new frame

text: I'm using a custom counter to cycle bullet point colours in beamer:               \documentclass{beamer}     \usepackage{graphicx,color}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{marvosym}          \newcommand{\myitem}[1]{\item[{\textcolor{#1}\Laserbeam}]}     \newcounter{myc}%[frame] <--if I uncomment [frame] it won't compile     \makeatletter     \def\newitem{     \stepcounter{myc}%     \ifnum\value{myc}=1       \myitem{red}     \else\ifnum\value{myc}=2       \myitem{green}     \else\ifnum\value{myc}=3       \myitem{blue}       \setcounter{myc}{0}     \fi\fi\fi     }          \begin{document}     \begin{frame}         \begin{itemize}             \newitem An item             \newitem Another item             \newitem Yet another item             \newitem These items...             \newitem ...are rather boring         \end{itemize}     \end{frame}          \begin{frame}         \begin{itemize}             \newitem An item on a second slide             \newitem Another item             \newitem Yet another item             \newitem These items...             \newitem ...are rather boring         \end{itemize}     \end{frame}     \end{document}      with the following result (2 slides combined in to 1 image) ![example, non resetting](http://i.stack.imgur.com/SyNcI.png) However I would like the colours to reset at the start of a new frame, without having to insert `\setcounter{myc}{0}` after each `\begin{frame}` Based on this answer I thought I might be able to use `\newcounter{myc}[frame]`, but I can't: `! LaTeX Error: No counter 'frame' defined.` So how do I reset a counter per frame?


title: mdframed incompatible with paralist

text: Compare `mdframed` with boxed `minipage` in the following example:               \documentclass[11pt]{book}     \usepackage[neveradjust]{paralist}%     \usepackage{boxedminipage}     \usepackage{mdframed}     \begin{document}     %\begin{boxedminipage}{125mm}     \begin{mdframed}         \begin{asparaenum}[\bfseries i.]%i, ii, iii.          \begin{minipage}[t]{72mm}                \item%i     xxxxxxxxxxxxxxxxx     \end{minipage}          \begin{minipage}[t]{72mm}                \item%ii     yyyyyyyyyyyyyyyyy     \end{minipage}              \end{asparaenum}%i, ii, iii.     %\end{boxedminipage}     \end{mdframed}     \end{document}


title: Book or website about book design

text: I am planning to study about book design. The final object is that given a book I can write a latex book template to achieve the same style. Could you recommend me some books or website to learn this kind of knowledge? What I have learned is through the book "LaTeX beginner's guide".


title: how to make ragged bottoms of columns in multicols when preventing page breaks?

text: The setup: I need to use multicols for say 3 columns where I have many small sections. I noticed that some sections are broken in the middle and end up wrapping to the next column, which I do not want. After some research (i.e googling) found that adding `\interlinepenalty=10000` prevents this. And it does. Multicol - don't wrap But instead of having the gaps at the bottom of the columns (ragged bottoms, or whatever the correct name for it), the columns end up with large empty space in between, which does not look good. ![Mathematica graphics](http://i.stack.imgur.com/VD67v.png) generated using:               \documentclass[10pt,notitlepage]{article}%     \setlength{\columnseprule}{0pt} %column thicnkess      \setlength{\columnsep}{5.0pt}     \usepackage{lipsum}     \usepackage{multicol}     \usepackage{titlesec}     \titleformat{\section}{\large\bfseries}{\thesection}{1em}{}     \begin{document}     \begin{multicols*}{3}          \interlinepenalty=10000     \section{some section}     \lipsum[75]     \section{some section}     \lipsum[75]     \section{some section}     \lipsum[3]     \section{some section}     \lipsum[75]     \section{some section}     \lipsum[75]     \section{some section}     \lipsum[75]     \section{some section}     \lipsum[4]     \section{some section}     \lipsum[75]     \end{multicols*}     \end{document}      removing `\interlinepenalty=10000` gives ![Mathematica graphics](http://i.stack.imgur.com/IVooa.png) which I do not want since section is flowing across columns. Removing the star version does not help either. One must use `\interlinepenalty=10000` to prevent page break inside a section. But then the problem are those large gaps in between sections. Then I used `samepage` to wrap each section inside it in the hope it will help. But this result was more strange. I must have done something wrong here: ![Mathematica graphics](http://i.stack.imgur.com/ouat2.png) Here is the code for the above               \documentclass[10pt,notitlepage]{article}%     \setlength{\columnseprule}{0pt} %column thicnkess      \setlength{\columnsep}{5.0pt}     \usepackage{lipsum}     \usepackage{multicol}     \usepackage{titlesec}     \titleformat{\section}{\large\bfseries}{\thesection}{1em}{}     \begin{document}     \begin{multicols}{3}          %\interlinepenalty=10000          \begin{samepage}     \section{some section}     \lipsum[75]     \end{samepage}          \begin{samepage}     \section{some section}     \lipsum[75]     \end{samepage}          \begin{samepage}     \section{some section}     \lipsum[3]     \end{samepage}          \begin{samepage}     \section{some section}     \lipsum[75]     \end{samepage}          \begin{samepage}     \section{some section}     \lipsum[75]     \end{samepage}          \begin{samepage}     \section{some section}     \lipsum[75]     \end{samepage}          \begin{samepage}     \section{some section}     \lipsum[4]     \end{samepage}          \begin{samepage}     \section{some section}     \lipsum[75]     \end{samepage}          \end{multicols}     \end{document}      What is the correct way to prevent page breaks in the middle of sections, but have the extra space be at the bottom and not in between? Using Tex live 2013 on Linux. (ps. one day, I need to learn how to use Latex to make copies code fragment to I do not copy paste same code again and again).


title: amsart/amsbook with non-default glossary style

text: I am using `amsbook` with the `glossaries` package. The following MWE produces a glossary in which the single entry is completely squashed up in the middle; it looks like no space at all has been allocated for the second column. Is there some conflict between `amsbook` (and `amsart`) and the non-default glossary styles?               \documentclass{amsbook}     \usepackage{glossaries}     \makeglossaries     \glossarystyle{long3col}     \newglossaryentry{x}{name=x,description={a helpful description of x}}     \begin{document}     Here is \gls{x}.     \printglossary     \end{document}      The glossary is fine if either I switch to a non-AMS document class, or I switch to the default glossary style, neither of which I want to do. The only similar problem I can find is Undefined control sequence \glossarytoctitle using amsbook, but I haven't changed the font size or linespread.


title: TikZ Matrix 'draw' alignment

text: Apologies if this has already been asked - I could not find it. The following is an example of what goes wrong: ![enter image description here](http://i.stack.imgur.com/4ZFtE.png) In this example I would like it to look just like a regular 2x3 table, but I think the problem is that draw starts from the end of the math, not the end of the cell. (I'd prefer to not just use tabular as I will be arrows between columns ultimately)               \begin{tikzpicture}     \matrix[matrix of math nodes,nodes in empty cells,nodes={anchor=center},text depth=0.5ex,text height=2ex,inner sep=2pt,row sep=1.5em,column sep=1.5em,] (M)     {     0 & 0 & 0 \\     a+b+c+d+e & a+b+c+d+e & a+b+c+d+e \\     }    ;     \draw[] (M-1-1.north west) -- (M-1-3.north east);     \draw[] (M-2-1.north west) -- (M-2-3.north east);     \draw[] (M-2-1.south west) -- (M-2-3.south east);     \draw[] (M-1-1.north east) -- (M-2-1.south east);     \draw[] (M-1-2.north east) -- (M-2-2.south east);     \draw[] (M-1-3.north east) -- (M-2-3.south east);          \end{tikzpicture}


title: TikZ diagonal text

text: Can you rotate text diagonally in TikZ / latex? I tried               \coordinate (P) at (0,0) ;     \draw[rotate around={45:(P)}] (P) node {hello} ;      But it just draws the text straight (horizontally). I want the text to go at a 45 degree incline.


title: How to load manual font from manfnt?

text: In the TeXBook, it says that: `{\manual\char127}` prints the _dangerous bend glyph_. But it doesn't. I can do it with `\manfntsymbol{127}`, but how can I switch to the `manfnt` font? `\font{manfnt}` doesn't work, either.


title: Text Editor to Keep Bilingual Versions of Text in Sync

text: I'm going to write two versions of a book simultaneously in two different languages, with math, data, and figures thrown in. The end product will consist in two books, each written in a single language (and each with its language-specific typographic styles), but sharing the data that appears in tables, figures and text. I expect to write the tables and figures in R and use knitr to compile the book. I'm looking for a text editor that would be suited to side-by-side display, preferably with coordinated scrolling of the two panes, and that could be set up to compile with LaTeX and XeLaTeX.


title: Making a range macro

text: Having syntactic sugar for ranges can be useful in programming languages. For example in Ruby, one can use a range by               (2..10).map {|elem| elem + 1}      to get an array consisting of each element in the range added by one (`[3, 4, ..., 11]`). I've found it helpful to take a look at how things are done in other languages which use Alonzo Church's lambda logic, in this case, Scheme:               (define (range low high)       (cond         [(> low high) null]         [else (cons low (range (+ low 1) high))]))      (I'm assuming that `[...]`-syntax is specific to PLT Scheme. The above is taken from this webpage.) So, recursion, eh? Sure, why not:               \def\range#1#2{\ifnum#1>#2\else#1, \range{\the\numexpr#1+1\relax}{#2}\fi}     \range{2}{10}     \bye      Well OK, I get the range (with a surplus comma at the end), but it starts to choke on larger ranges. Why? Looking at the log-file might give a clue with `\tracingmacros=2`:               \range #1#2-><macro definition>     #1<-\the \numexpr \the \numexpr \the \numexpr \the \numexpr ...     #2<-10      OK, I get the idea. So I'd need to throw in some `\expandafter`s, right?:               \catcode`@=11          \def\R@nge#1#2{\number#1 \ifnum#1<#2, \expandafter\R@nge         \expandafter{\number\numexpr#1+1\expandafter}%         \expandafter{\number#2\expandafter}\fi}          \R@nge{2}{10}     \bye      Now it doesn't choke. I've fallen in love with Alan Jeffrey's `lambda.sty` for lists in TeX's mouth, and so my instinct was to try and make that range into a list:               \catcode`@=11     \input lambda.sty     \def\R@nge#1#2{\number#1 \ifnum#1<#2, \expandafter\R@nge         \expandafter{\number\numexpr#1+1\expandafter}%         \expandafter{\number#2\expandafter}\fi}          \Unlistize{\Listize[\R@nge{2}{10}]} % works, but getting back to the ruby example,          \def\Succ#1{\the\numexpr#1+1\relax}          \Unlistize{\Map\Succ{\Listize[\R@nge{2}{10}]}} % doesn't work     % (expected result: [3, 4, 5, 6, 7, 8, 9, 10, 11],     % instead of: [2, 3, 4, 5, 6, 7, 8, 9, 10+1].)     \bye      Maybe those `\expandafter`s are getting back to haunt me at this stage? So next I tried to follow more strictly the Scheme version:               \catcode`@=11     \input lambda.sty     \def\Range#1#2{\TeXif{\ifnum#1>#2}{\Nil}%       {\Cons{#1}{\Range{\number\numexpr#1+1}{#2}}}}          \Unlistize{\Range{2}{10}}     \bye      Looks about the same as the Scheme version, doesn't it? Alas, it returns an empty list! ## The Question **How can I make a range-macro which would output a list (in the`lambda.sty`-sense) so I can use `\Map` and such with it?** I have an inkling that the command should somehow resemble the `\Listize`-macro from `lambda.sty`:               \def\Listize[#1]%        {\Listize@#1,\relax]}     \def\Listize@#1,#2]%        {\TeXif{\ifx\relax#2}%             {\Singleton{#1}}%             {\Cons{#1}{\Listize@#2]}}}      But I haven't been able to figure out what to change and how.


title: Lstlistings: Getting pretty equations in display mode

text: I am currently trying to print my algorithms using the listings package. For clarity I always try to display the more complex mathematical expressions as formula instead of plain code. This results in having to escape to latex for my formula, incase it gets to big for an inline formula. In theory, everything is working just fine with the following code:               \begin{lstlisting}[escapeinside={/*@}{@*/}]     for (j = 1; j <= p; j++) {         for (m = 0; m <= p-j ; m++) {/*@         \begin{equation*}\begin{split}             c &= \frac{t - t_{i - m}}{t_{i - m + p - j+1} - t_{i-m}};\\             d^{(j)}_m &= (1-c)\cdot d^{(j-1)}_{m+1} + c\cdot d^{(j-1)}_m;         \end{split}\end{equation*}\stepcounter{lstnumber}\stepcounter{lstnumber}@*/         }     }     \end{lstlisting}      This gives me the following output: ![Result](http://i.stack.imgur.com/tBTbu.png) As you can see, the result is not that pretty. Now my question(s):   * Do you know a more elegant way to insert the equations to listings?   * If not, it would be a huge gain if it is possible just to shift the equations to the left (which I remember having seen somewhere, but I do not remember how to do it...)   * The perfect solution would be reached if you also know a way how to insert the line numbers (and may it even be inserting them manually and placing them by "hand") Thank you for all your ideas. P.S.: In case you wonder: The code is part of the algorithm of de Boor.


title: How to vertically align title in LaTex

text: I'm finishing my master's thesis and would like to move the title vertically more down towards center of the page...I googled, but couldn't get it to work =/ Here is a portion of my code from the beginning, which creates the title page:               \begin{document}     %\layout     \title{My title}     \author{My name}          \maketitle     \thispagestyle{empty}           \vfill     \begin{flushright}     My name     My Faculty      2013     etc     \end{flushright}          \newpage     .     .     .      Now with this code my title goes to the very top of the first page...how to modify the code so that I can move it around vertically? I also tried to put `\vspace` above the `\maketitle`, but the title remained where it was...:S


title: Alternating header in scrreprt with scrpage2

text: I want to achieve the following: In a twoside document I want to display the chapter title on even pages and the section (plus subsection if there is one) title on odd pages. So that for odd pages it looks like "section -- subsection" if there is a subsection and "section" otherwise. So far, I do it this way:                   \documentclass[a4paper, 12pt, twoside, openright, appendixprefix, BCOR7.5mm, pointlessnumbers, bibliography=totoc, listof=totoc]{scrreprt}         \usepackage[utf8]{inputenc}         \usepackage[american]{babel}         \usepackage{blindtext}              \usepackage{scrpage2}              \begin{document}              \pagestyle{scrheadings}         \automark[subsection]{chapter}         \renewcommand*{\sectionmark}[1]{%             \markright{\ifnum \value{secnumdepth} >0 \sectionmarkformat\fi             #1}}%         \setheadsepline{.2pt}         \ohead{\headmark}              \chapter{Chapter 1}         \section{section}         \blindtext[15]              \chapter{Chapter 2}         \section{section}         \subsection{subsection}         \blindtext[15]              \end{document}      This works so far in that it displays chapter and section OR subsections, respectively. Now I want to display both, section and subsection. How can I do this? Thank you. Edit: Added example.


title: longtable example+error:Package longtable Error: Column widths have changed in table...

text: I'm trying to use a longtable in landscape. I obtain a compilation error (I use XeLaTex) and I don't know where is the problem. The code is:               \begin{landscape}     \begin{longtable}{ccccccc}     \caption{My table.}     \label{tab:table} \\     \toprule     \multicolumn{1}{c}\textbf{} & \multicolumn{1}{c}\textbf{A} & \multicolumn{1}{c}\textbf{B} & \multicolumn{1}{c}\textbf{C} & \multicolumn{1}{c}\textbf{D} & \multicolumn{1}{c}\textbf{E} & \multicolumn{1}{c}\textbf{F}\\     \midrule     \endfirsthead     \multicolumn{7}{l}{\footnotesize\itshape\tablename~\thetable: continue from previous page} \\      \toprule     \multicolumn{1}{c}\textbf{} & \multicolumn{1}{c}\textbf{A} & \multicolumn{1}{c}\textbf{B} & \multicolumn{1}{c}\textbf{C} & \multicolumn{1}{c}\textbf{D} & \multicolumn{1}{c}\textbf{E} & \multicolumn{1}{c}\textbf{F}\\     \midrule     \endhead     \midrule     \multicolumn{7}{r}{\footnotesize\itshape\tablename~\thetable: continue to next page} \\     \endfoot     \bottomrule     \multicolumn{7}{r}{\footnotesize\itshape\tablename~\thetable: end} \\     \endlastfoot     % table body     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7\\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7\\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \midrule     \textbf{1} & 2 & 3 & 4 & 5 & 6 & 7 \\     \bottomrule                                      \end{longtable}     \end{landscape}      The error is:                Package longtable Error: Column widths have changed in table 2.1       See the longtable package documentation for explanation.       Type  H <return>  for immediate help.       ...                                                         l.901 \end{longtable}      Any ideas?


title: How to use different colors for different \href commands?

text: I have two different `\href{}{}` links and I want each to be a different color. In the example below they will both be blue, how can I make each link have a different color?               \documentclass{article}     \usepackage[colorlinks = true,                 linkcolor = blue,                 urlcolor  = blue,                 citecolor = blue,                 anchorcolor = blue]{hyperref}     \begin{document}     Here is \href{http://www.google.com}{Google} and \href{http://www.yahoo.com}{Yahoo!}.     \end{document}      Thanks in advance for your help.


title: Table including rows of a master table

text: I have a big master-`table*` containing reference items and that is a simple cross-project database of such items. Now I'd like to include in different documents parts of this master table and select arbitrary rows depending on the particular document's foucs. To give an example: The master table contains items one can buy in a game. A typical row contains an item's label, cost, weight, some properties and a description column. Now I have different XeLaTeX documents containing game rules that focus on certain time periods (medieval, renaissance, modern day, sci-fi, ...). Some items of the master table are in use in some time periods (e.g. a sword, or a cell phone). Here a short example of two such rows:               Hammer & 1 & 0 & 1 & 10 & 1 & \\     Longsword & 2 & -1 & 2 & 75 & 2 & two-handed \\      I would like to hand-pick the items from the master table to be shown in the individual table (and not filter by some field or flag), but like to reference the base record only, so that if I make changes on the master table and e.g. change the weight or price, that automatically is also done in all derived tables. Is there a best practice how to do that?


title: What's the most elegant way to obtain Dirac operators? (slash notation)

text: What's the best way to achieve the Dirac slash notation for Dirac operators (contraction with Gamma matrices)? I would have thought the AMSmath packages would have this built in somewhere. (The cancel package springs to mind, but surely there is an easier method?)


title: Images off the page in multicols environment

text: Before my question, some background information. I’ve created an algorithm (not latex) which will generate a catalog for a collection of books dynamically. A user supplies information to query an SQL database to retrieve book information and also defines the structure of the catalog in an XML file. Finally, through a series of automated steps, `.tex` files are generated which are then run through latex to create the catalog PDF file. Everything works well except for adding images in which through trial and error I’ve discovered that the package `picins` works easily and well with the `multicol` package and looks great too. The only trouble I am encountering is that it appears that the `picins` package does not calculate when an image will appear off the page, so from time to time images appear off the page in the catalog. Since these catalogs are generated automatically, the less human interaction the better. Adding `\columnbreak` prior to a paragraph which is textwrapped by `parpic`, does fix the issue, however performing this manually is not a solution since there are hundreds (perhaps thousands) of books which will make up each catalog. Surrounding the paragraph and image in a `\parbox` will keep the image from going off the page; however it creates a lot of white space and adds pages to the catalog. Since this catalog will be printed, extra pages means more money, so white space must be kept to a minimum. I'm quite stuck on a solution, I aplogize but my questions are broad. I appreciate your suggestions. Would it make sense / is it possible to calculate the lines remaining in a column and use the `ifthen` package to insert a `\columnbreak` automatically? Is there a better solution than `picins` which works nicely with the `multicol` package that will automatically break the column if the image will not fit? Thank you for your help. The MWE is as follows:               \documentclass[english]{book}     \usepackage{multicol}     \usepackage[T1]{fontenc}     \usepackage{babel}     \usepackage[includeheadfoot,top=.25in,bottom=.25in,left=.5in,right=.5in]{geometry}     \usepackage{graphicx}     \usepackage{picins}     \usepackage{blindtext}          \setlength{\columnsep}{0.375in}          \begin{document}     \begin{multicols*}{2}     \noindent\blindtext[5]\\     \pichskip{.25in}\noindent\parpic[sr][r]{\includegraphics[width=2in]{dog.png}\picskip{15}}     \blindtext     \end{multicols*}     \end{document}      Dog image (for testing purposes): ![Dog](http://i.stack.imgur.com/MPRGi.png) The output: ![The output](http://i.stack.imgur.com/yQKHC.png)


title: Problem with Beamer, phantom, and definition environment

text: The following code tries to put a `vphantom` around a `definition` environment in a Beamer document but it does not compile properly.               \documentclass{beamer}     \usepackage{mathtools}     \begin{document}     \begin{frame}      Before       \begin{definition}       inside      \end{definition}      after     \end{frame}     \begin{frame}      Before      \vphantom{       \begin{definition}        inside       \end{definition}      }      after     \end{frame}     \end{document}      The two frames created during the failed compilation are ![good](http://i.stack.imgur.com/xv2wb.png) and ![bad](http://i.stack.imgur.com/pLiRv.png) What is going wrong?


title: How can I generate PDF metadata from LaTeX?

text: I am writing a document using LaTeX and generating PDF. Can anybody tell me how I can generate the PDF metadata, e.g. author or title, from LaTeX? On Windows XP, I am using MikTex's texify to generate the PDF. On linux, I am using pdflatex to generate the PDF. Any answers for either platform would be much appreciated!


title: Different style for acronyms

text: In 1 I had the answer on how to put the translation of an acronym and used both English and Spanish version. The issue now is that I have acronyms that are only Spanish, others only English without translation and English with translation. The format for the document mandates that English is written emphasized while Spanish is in normal. Is there any way of automating it? I was thinking on having 2 list, English acronyms and only Spanish, then load them, assigning a different style and then merging them so in the list of acronyms they appear in order. The other solution I have found is on my acronym's list create two styles:               \newcommand{\engstyle}[1]{\emph{#1}}     \newcommand{\espstyle}[1]{#1}     \newacronym{ENG}{ENG}{\engstyle{English acronym}} %     \newacronym{ESP}{ESP}{\espstyle{Spanish acronym}} %      But then in the list of acronyms they appear with the assigned style. And I want them without any style. Any suggestion? **Edit: What I want as exit.** Within the test _English acronym_ (ENG) is displayed and the Spanish one this way, Spanish acronym (ESP). List of Acronyms ENG English acronym ESP Spanish acronym Edit 2: I didn't realize that Nicola updated the package. Now the question is: Is it possible to set multiple setacronymstyle within the same doc?


title: Boxed minitoc with each chapter

text: ![](http://i.stack.imgur.com/U7jlO.png) How can I do a boxed minitoc at the beginning of any chapter like this. It is too hard for me.


title: How I draw graphics of dominoes falling?

text: How I draw graphics of dominoes falling, without moviment, static draw?


title: Artifical bold of a font (as vector) by a thicker stroke in Latex?

text: I guess this was asked already at Can I make a greek letter extra-bold, e.g. make strokes 1.5 times as thick as \bm does, in math mode?, but it didn't get the answer I wanted to read, so I'll try again `:)` I'm not interested in bold math here, my situation is this: I like `lmtt` teletype font, and the only thing I'd like is to make `lmtt` a bit bolder; I know about `[lighttt]`, but I don't like it so much - and I would not like to change to a different typewriter font just because of this. But this problem could occur in a different context, too, which is why I would like to ask in more generic terms: would it be possible in Latex to "derive" a "bolder" version of a font, by re-"stroking" the letters with a thicker line? I would guess, out of the box no - but I wanted to confirm that. As far as I can remember, in PDF itself, you declare a font, and a family/size for it, and when you place a text PDF primitive, the letters are simply used to look up the font glyph, which is then placed. As there is no "line width" parameter there (that I can remember) for the font stroke, I doubt Latex could use something like that either. However, maybe somehow Latex could be used, for each such "artificially" bold letter, to:   * re-draw the letter with a given stroke   * convert the stroke to a filled path   * find the union of the filled path and the path derived from stroke   * insert this vector as a glyph in a new font table exported in the PDF Not even sure if Latex does these kinds of operations (though I guess Tikz, or LuaLatex, might) - but I think it would be nice to know what are the possibilities for them. I also just found this: Any way to strengthen font weight/darkness/heaviness? > For actual printing, you could set the MF options and generate new bitmaps > to use (as a Type 3 bitmap font), but that's an awkward solution. So apparently, there is a possibility for a bitmap approach with Metafont - but here I'm interested in a vector approach. I'd be OK with using external programs, too, as long as all work can be initiated by Latex (via `-shell- escape`).


title: Newline between beamerboxesrounded and itemize

text: In `Beamer` class, I try to put an `itemize` within `beamerboxesrounded`. Now when I try:               \documentclass{beamer}          \begin{document}         \begin{frame}             \begin{beamerboxesrounded}             % Add a newline here                 \begin{itemize}                     \item 1                     \item 2                     \item $\ldots$                 \end{itemize}             \end{beamerboxesrounded}         \end{frame}     \end{document}      it gives an error: `TeX capacity exceeded, sorry [input stack size=5000] \end{frame}`. But when I put leave the commented line empty, it works fine. I am curious to know why this is happening.


title: Acute accent and dot below problem in XeLaTeX for "i"

text: I want to add a dot below í, like this: "ị́." I am using `XeLaTeX`, with `fontspec`. My code looks like this:               \documentclass{article}     \usepackage{fontspec}     \setmainfont{CMUSerif-Roman}     \begin{document}     \d{\'{i}}     \end{document}      When I use Computer Modern Unicode font, the result glyph has the acute accent symbol over the original dot of `i`. From top to down are, acute accent symbol, dot, line and dot (the dot below `\d`) respectively. When I switched the font to Times, everything works fine. I also tried Unicode combining diacritic which works fine in other apps (TextEdit and Safari on Mac, for example) but failed in `XeLaTeX`. When I tried to copy the nested glyph from output PDF directly, the paste is "i, COMBINING DOT BELOW, COMBINING ACUTE ACCENT", even if the original sequence is "i, COMBINING ACUTE ACCENT, COMBINING DOT BELOW". It seems that "i" combines with "DOT BELOW" first, making the ligature í unmatched. How to solve this problem?


title: Representation of subsubsection numbers simpler

text: I have               \documentclass{article}          \usepackage[framemethod=tikz]{mdframed}          %%%%%%%%%%%%%%%%%%%%%%%% Counter Section %%%%%%%%%%%%%%%%%%%%%%     \makeatletter       \def\@part[#1]#2{%         \ifnum \c@secnumdepth >\m@ne           \refstepcounter{part}%         \fi         \addcontentsline{toc}{part}{#1}%         {\parindent \z@ \raggedright          \interlinepenalty \@M          \normalfont          \LARGE \bfseries #2%          \markboth{}{}\par}%         \nobreak         \vskip 3ex         \@afterheading}     \@addtoreset{section}{part}         \makeatother     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}     \part{CIRCULATION and HEART}     \subsection{Characteristic of the circulatory system}     \subsubsection{Account for the functions of circulatory system and indicate which other systems cooperate with circulation}     \end{document}      I see in the table of contents ![enter image description here](http://i.stack.imgur.com/42IQV.png) I want to see (without the date) such that the subsubsection is marked simply by a single number (and if possible part command would include the section). ![enter image description here](http://i.stack.imgur.com/lV0Nk.png) **How can you have only the iterative number in the representation of the subsubsection?**


title: \vfill throws my boxed text at the end and cannot be read

text: I'm trying to place a boxed text at the end of the page, but \vfill sends my box out of the page. There is another command that can do the same but in the way I need it? This is my code:               \documentclass[12pt,letterpaper]{article}     \usepackage{background}     \usepackage{framed}     \usepackage[latin1]{inputenc}     \usepackage[spanish]{babel}     \usepackage[total={19.5cm,26.5cm},left=0.7cm,top=3cm]{geometry}          \SetBgScale{1.05}     \SetBgAngle{0}     \SetBgContents{\includegraphics{image/bg.eps}}          \begin{document}          \font\grande=cmr10 at 30pt\vphantom{\grande M} %Places text below the top gray line          Random text.     \begin{framed}     Boxed text.     \end{framed}     \end{document}      The image places a 15mm box on the bottom edge as the image shows. ![enter image description here](http://i.stack.imgur.com/UQBjZ.png)


title: Lots of errors in default friggeri resumé cv

text: I get lots of errors when compiling (XeLaTeX, from up-to-date MiKTeX 2.9 x64, TeXstudio 2.8.0, Windows 8 x64) the friggeri-cv template. Download it here: http://www.latextemplates.com/template/friggeri-resume-cv . The errors:   * Missing endcsname inserted   * You can't use `dimexpr` in math mode. \begin{entrylist}   * Extra endcsname. \begin{entrylist}   * Missing font identifier. \begin{entrylist}   * Math formula deleted: Insufficient symbol fonts. \end{entrylist} All errors show up multiple times and I can not find any clues on their origin when looking around on the internet. The strange thing is that this CV did compile without errors in the past and I have adapted it for my personal use. My adaptation also compiled without problems. Now, I got many errors when compiling my CV (it has been a month or so since the last compile). So I tried compiling the default template to see whether it was my bad or not: I get the same errors. It appears either the template is not working any-more, or my (Xe)LaTeX installation is broken/bugged. I have also tried changing the fonts in the .cls file to Arial, but no luck there (I have Helvetica Neue installed, tough, and the font has worked for me before with this template). Have there been updates to packages in the last month, making the template unusable? Or is there a problem with my PC? Any help or thoughts are appreciated! Thanks. There are no errors when compiling when I disable alle `entrylist` environments and the line containing the `$\varheartsuit$`. As requested in a comment below: I can compile a pretty simple .tex file with both `pdflatex` and `xelatex` without errors, so both compilers can do their job. Another request from the comments: the .log file containing the errors I get when running `xelatex` on the default Friggeri template:   * .log file: https://copy.com/WloGkamcE0Uf   * .pdf file: https://copy.com/2WyARiQe439U   * what it should look like: http://www.latextemplates.com/templates/curriculum_vitaes/10/cv_10.pdf


How can I make a pair of words stick together in line breaks? For example, "MS Access". I don't want a line break in the middle. But, I'd like to set this up once, not at every occurrence of that word pair. **edit:** Check out Sveinung's answer for two possible problems - overfull line, and hyphenation. For sure, I don't want that.


title: Coloring rows in table

text: I have a problem with coloring table. I would like to color one row, but when I use `\rowcolor`, then vertical lines among colums disappear (or they become thinner). Is there any possibility of solving this problem? Thanks


title: Own command to create new environment

text: The following code isn't very minimal but I hope you will be able to understand the code.               \setcounter{errorcontextlines}{999}     \documentclass{scrartcl}     \usepackage{lipsum,ntheorem}     \usepackage[ntheorem]{mdframed}     \makeatletter     %\newtheorem{<envname>}[<numberedlike>]{<caption>}[<within>]     %\newmdtheoremenv[<mdframed-options>]{<envname>}[<numberedlike>]{<caption>}[<within>]     %\md@tempa[<mdframed-options>]     %\md@tempb{<envname>}%     %\md@tempc[<numberedlike>]%     %\md@tempd{<caption>}%     %\md@tempe[<within>]%     \newrobustcmd*\newmdtheoremenv{%        \kernel@ifnextchar[%]          {\newmdtheoremenv@i}{\newmdtheoremenv@i[]}%     }     \newrobustcmd*\newmdtheoremenv@i[2][]{%     \def\md@tempa{#1}%     \def\md@tempb{#2}%         \kernel@ifnextchar[%]          {\newmdtheoremenv@ii}{\newmdtheoremenv@ii[]}%     }          %\newmdtheoremenv@ii[<mdframed-options>]{<envname>}[<numberedlike>]{<caption>}     \newrobustcmd*\newmdtheoremenv@ii[2][]{%     \def\md@tempc{#1}%     \def\md@tempd{#2}%         \kernel@ifnextchar[%]          {\newmdtheoremenv@iii}{\newmdtheoremenv@iii[]}%     }          %\newmdtheoremenv@ii[<mdframed-options>]{<envname>}[<numberedlike>]{<caption>}[<within>]     \newrobustcmd*\newmdtheoremenv@iii[1][]{%        \def\md@tempe{#1}%        \ifboolexpr{ not (test {\ifdefempty{\md@tempc}})                   and                   not (test {\ifdefempty{\md@tempe}})                }{%                  \md@PackageWarning{You defined {\string\newtheorem} with ^^J                                     both optional arguments^^J                                      <numeredlike> and <within>. This isn't allowed^^J                                     \mdframedpackagename will use <numeredlike>\MessageBreak}%                  \newtheorem{\csname md\md@tempb \endcsname}[\md@tempc]{\md@tempd}%                 }%                 {\ifdefempty{\md@tempc}{}{\newtheorem{md\md@tempb}[\md@tempc]{\md@tempd}}%                  \ifdefempty{\md@tempe}{}{\newtheorem{md\md@tempb}{\md@tempd}[\md@tempe]}%                 }%        \ifboolexpr{test {\ifdefempty{\md@tempc}}                     and                     test {\ifdefempty{\md@tempe}}                    }{%                    \newtheorem{md\md@tempb}{\md@tempd}%                    }{}%     \expandafter\global\expandafter\@namedef\expandafter{\md@tempb}{%        \expandafter\mdfsetup\expandafter{\md@tempa}%                    \begin{mdframed}[]\begin{md\md@tempb}%         }%     \expandafter\global\expandafter\@namedef\expandafter{end\md@tempb}{%                   \end{md\md@tempb}\end{mdframed}%        }%     }     \makeatother     \begin{document}     {\small\verb+\newmdtheoremenv[mdframed-options]{envname}[numberedlike]{caption}[within]+}     \newmdtheoremenv[linecolor=blue,backgroundcolor=red]{beispiel}{Beispiel}     %\newmdtheoremenv[linecolor=red,backgroundcolor=yellow]{spiel}{Spiel}     \begin{beispiel}[Antwort]     Test     \end{beispiel}          \vspace*{2em}          %\hallo          \vspace*{2em}          %\begin{spiel}%[Antwort]     %Test     %\end{spiel}     \end{document}      I am trying to create the command `\newmdtheoremenv`. In the minimal example it works well as long as only one `\newmdtheoremenv` is used. When I use the second `\newmdtheoremenv` the first will be overwritten. How can I avoid this and how can I modify the example so that the command `\newmdtheoremenv` can be used multiple times.


title: How does beamer build the frame?

text: I've started to write my own theme for beamer. I'm bored of the default ones and I thought it might be a nice challenge to make something that looks good. The problem is that the beamer documentation doesn't really offer much in the way of explanation of how to write your own themes. It explains a little about what `\defbeamertemplate` does, but it doesn't explain, for example, that to customise the frame title you need to set up your own templates for `frametitle` and `headline`. I had to work this out by looking at what the default themes actually do. So my question is quite general: how does beamer build the frame? What template entities do I want to define to customise how beamer looks? And what does beamer actually do with them? For example, presumably at some point something is calling `\usebeamertemplate{frametitle}[<my theme>]` and `\usebeamertemplate{headline}[<my theme>]` but how and when?


title: Listings line numbers that match the linerange specification

text: This is a follow-up question to First line number in `lstinputlisting` environment. Consider the MWE:               \documentclass{article}     %\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox     \usepackage{filecontents,listings}% http://ctan.org/pkg/{filecontents,listings}     \lstset{       numbers=left,       basicstyle=\ttfamily\footnotesize     }     \begin{filecontents*}{mycode.txt}     Line 1     Line 2     Line 3     Line 4     Line 5     \end{filecontents*}          \makeatletter     % http://tex.stackexchange.com/q/26828/5764     %\patchcmd{\lst@GLI@}% <command>     %  {\def\lst@firstline{#1\relax}}% <search>     %  {\def\lst@firstline{#1\relax}\def\lst@firstnumber{#1\relax}}% <replace>     %  {\typeout{listings firstnumber=firstline}}% <success>     %  {\typeout{listings firstnumber not set}}% <failure>     \makeatother          \begin{document}     \lstinputlisting[linerange={1-3}]{mycode.txt}     \lstinputlisting[linerange={2-4}]{mycode.txt}     \lstinputlisting[linerange={2-2,4-5}]{mycode.txt}     \end{document}      _Without_ the aid of the `etoolbox` patch (or the default), the output looks like that of the leftmost column. _With_ the aid of the patch (a "`firstnumber` correction), the output looks like that of the middle side. However, I'd like the output to look like that of the rightmost column. ![enter image description here](http://i.stack.imgur.com/eX9iq.png) That is, the eventual output of line numbers should match that of the `linerange` specification. The trivial solution I'm hoping to avoid is the inclusion of separate `\lstinputlisting`s for each range with the appropriate vertical adjustment of `-2\medskipamount` (default space above/below an included listing). That was how the rightmost column was obtained in the first place.


title: inserting external LaTeX tables made by Stata into Scientific Workplace 5.50

text: I am trying to insert a table of statistical output into SWP 5.50 from an external file. The table is generated by my statistics program, and it looks something like this:               \begin{table}[htbp]\centering     \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}     \caption{OLS Results}     \begin{tabular}{l*{1}{c}}     \hline\hline                         &\multicolumn{1}{c}{Price}\\     \hline     Mileage (mpg)       &      -294.2\sym{***}\\                         &     (-5.28)         \\     Foreign             &      1767.3\sym{*}  \\                         &      (2.52)         \\     Constant            &     11905.4\sym{***}\\                         &     (10.28)         \\     \hline     Observations        &          74         \\     \hline\hline     \multicolumn{2}{l}{\footnotesize \textit{t} statistics in parentheses}\\     \multicolumn{2}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\     \end{tabular}     \end{table}      When I use the Import Non-SWP/SW LaTeX function, I get the error that the file is not valid for the selected filter. I am able to insert figures. I can insert it as a TeX Field, but that makes it hard to update when I change the specification of the regression. Any advice about how to get this to work? I've not been able to locate any info on this in the MacKichan forum or anywhere else on the web.


title: Is there a proper way to use mathdesign fonts in amsart?

text: \documentclass{amsart}     \usepackage[bitstream-charter]{mathdesign}      gives               Package mathdesign/mdbch Warning: Package 'amsfonts' shouldn't be used in conjonction with package mdbch      Is there a 'proper' way to use `mathdesign` fonts in `amsart`?               \documentclass[noamsfonts]{amsart}      produces an error. I know there are hacks, not looking for those. (I need to share my files with co-authors so they better be clean, if I want my colleagues to tolerate my font extravaganza.)


title: Breaking a long math expression

text: I am trying to type long expression by using parenthesis inserting some sentences, as an example I have a expression like product of               \documentclass{12 pt}{article}     \begin{document}     \begin{multline}     (product of (A\times_{c} B) by C)\times_{c} D) by E.     \end{multline}     \end{document}       I am using `multline` environment but I have problem with breaking into different lines. Is there any easy way to break the lines?


title: fail to add Chinese punctuation after CJKnumber in chatper title in xeLaTeX

text: I'm writing my thesis in Chinese with xeLaTeX and I've to format the chapter name and section name. The following command works ok:                \usepackage[CJKnumber][xeCJK]      \renewcommand{\chaptername}{\CJKnumber{\thechapter}}      except that I still need to add Chinese punctuation after the number. e.g                 一、第一章      （一） 第一节      the compiler would complain `! Missing number, treated as zero.` if I did so:                \usepackage[CJKnumber][xeCJK]      \renewcommand{\chaptername}{\CJKnumber、{\thechapter}}      Any ideas to work around this ? example:                 \documentclass{report}       \usepackage[CJKnumber]{xeCJK}       \usepackage{titlesec}            \renewcommand{\chaptername}{\CJKnumber{\thechapter}、}        \titleformat{\chapter}{\xiaosihao\hei}{\chaptername}{0.1em}{}       \newcommand{\sectionname}{（\CJKnumber{\thesection}）}         \titleformat{\section}{\xiaosihao\hei}{\sectionname}{0.1em}{}             \begin{document}       \chapter{第一章}       \section{第一节}       \end{document}      I'm able to get chapter name to work now but section number turns out to be `（.1 一）` instead of `（一）`


title: Pseudocode, special formatting

text: I want to write an algorithm in LaTeX. It's not any programming language, it is pseudocode with a very mathematical style. Furthermore it is divided in a main function and some subfunctions. I also would like to be able to comment (almost) every line to describe what it is used for. As an example, you may want to take a look at this link: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.83.3496&rep=rep1&type=pdf See page 10 for the code. I would like to write it in the very same style if this is somehow possible. Any help is appreciated :)


title: Tikz Axis bounding box does not align with other bounding boxes. What can I do?

text: I want to place a lot of pictures and plots in a long document. By now, I am using figure-environment with center-environment, but the tikz-axis-plots didn't align well with included eps-pictures or tikz-pictures. I read PGFplot to occupy full \linewidth, and aligned y=axis across tikzpicture and the pgfplot-Manual (regarding alignment), and found out, that I can use ylabel style={overlay} and yticklabel style={overlay}. To be precise, the situation is better, but images are still not aligned well. I want the left and right border of the grid to be exacly above the other boxes. See my example for illustration. Thanks in advance.                   \documentclass{scrartcl} % Dokumentenklasse         \usepackage[decimalsymbol=comma]{siunitx} % SI-Einheiten einheitlich setzen              \usepackage{pgfplots,pgfmath} % Import der Plots aus Matlab         \usepackage{tikz} % Import der Plots aus Matlab         \usetikzlibrary{plotmarks} % Import der Plots aus Matlab         \newlength\fheight % Plots aus Matlab immer gleich gross         \newlength\fwidth % Plots aus Matlab immer gleich gross         \setlength\fheight{6cm} % Plots aus Matlab immer gleich gross         \setlength\fwidth{8cm} % Plots aus Matlab immer gleich gross         \pgfplotsset{ % Komma statt Punkt als Dezimaltrennzeichen           x tick label style={/pgf/number format/use comma},           y tick label style={/pgf/number format/use comma}}              \begin{document}         \begin{figure}[!htb]             \begin{center}         \begin{tikzpicture}              \begin{axis}[%         scale only axis,         width=\fwidth,         height=\fheight,         xmin=0, xmax=15,         ymin=0, ymax=200,         xlabel={$t/\SI{}{\minute}$},         ylabel style={overlay},         yticklabel style={overlay},         ylabel={$d_\textrm{Nitrid}/\SI{}{\nano\meter}$},         xmajorgrids,         ymajorgrids,         zmajorgrids]              \addplot [         color=black,         only marks,         mark=*,         mark options={solid,fill=green}         ]         coordinates{         (12,159.2)(12,160)(6,78.7)(6,78.7)(6,78.3)(6,77.8)          };         \end{axis}         \end{tikzpicture}           \caption{Axis example}             \label{asdf1}           \end{center}         \end{figure}                        \begin{figure}[!htb]             \begin{center}         \begin{tikzpicture}[even odd rule,rounded corners=2pt,x=10pt,y=10pt]         \filldraw[fill=green] (0,0) rectangle (\fwidth,\fheight);         \end{tikzpicture}           \caption{Size of the pictures}             \label{asdf2}           \end{center}         \end{figure}                   \end{document}


title: fontspec + package "accents" (bezos) = "! LaTeX Error: Command `\acute' already defined."

text: I am trying to define the "less-than" Symbol "<" as a math-accent via the "accents" package of Javier Bezos.               \documentclass{minimal}     \usepackage{fontspec}     \usepackage{accents}          \begin{document}          $\accentset{<}{A}$          \end{document}      However, I get the following error message:               ! LaTeX Error: Command `\acute' already defined.      Leaving out the fontspec-package does the trick. Unfortunately, I need it for the rest of the document. Is there a way to get around this problem?


title: Execute token after \halign

text: I like to create a macro which processes a following brace group as "argument" using `\halign`. After it has been processed a token (a macro) should be executed. With an `\hbox` I can use `\aftergroup\mytoken` direct after the opening brace to execute something after the closing brace. However, this doesn't work with `\halign` because every cell it is own group and `\aftergroup` would place something in the next cell. I also had the idea to have some recursive `\aftergroup` macro which places itself always in the next cell until the last cell is reached. But this would break any `\noalign` code added after a `\cr` (or `\\\` in LaTeX), beside being tricky in the first place. Is there any way to use `\afterassignment`, `\aftergroup` or any other way to execute a macro after the `}` of `\halign`? Alternatively placing a `\egroup` before it and use the `}` as end of an outer group would also be fine.               \documentclass{article}          \def\mytab{%         \afterassignment\dotab         \let\dummy=%     }     \def\dotab{%         \AFTERHALIGN\dosomethingafterwards         \halign\bgroup             \hfil\ignorespaces##\unskip\cr     }     \def\dosomethingafterwards{...}          \begin{document}          \mytab{%         A \cr         B \cr         C \cr     }          \end{document}


title: Strange vertical space before the caption of a longtable with KOMA-Script classes when xcolor is loaded

text: When using one of the main KOMA-Script classes — `scrartcl`, `scrreprt`, `scrbook` but not `scrlttr2` —, the vertical position of the caption in a `longtable` environment changes when one loads or unloads the `xcolor` package: if the latter is loaded, there is an additional spacing above the caption. Here is a minimal working example.               \documentclass[a4paper]{scrartcl}% scrartcl, scrreprt, scrbook          \usepackage{xcolor}% comment and uncomment to see the effect     \usepackage{longtable}          \begin{document}     %     \noindent%     \centering%     Blah blah blah blah.     \begin{longtable}{l l l l}     \hline     \caption{Caption} \\     \hline     \endfirsthead     \hline     \endfoot     Cell & Cell & Cell & Cell \\     Cell & Cell & Cell & Cell \\     \end{longtable}     Blah blah blah blah.     %     \end{document}      The result is given in the following picture. ![Caption spacing in longtable whether xcolor is loaded or not](http://i.stack.imgur.com/nL4fZ.png) The problem also happens if I load `xcolor` after `longtable` or if I put the caption at the foot of the table. **But** , if I load the `caption` package, the additional space disappears and the result is the first — expected — one in every case. I just don’t need this additional package, provided that I can get what I want with the commands and options from the KOMA-Script classes. Finally, there is no such situation with the standard classes, whether the package `caption` is loaded or not. (Just a few remarks about my code: I have only inserted the `\hline` before the caption to make the situation clearer, and the problem still occurs without it; furthermore, in a final version, I would obviously use `\captionabove` instead of `\caption` or the KOMA-Script option `captions=tableheading`, as well as `booktabs`!) The question is: how do I get rid of the additional space without loading the `caption` package? I have a subsidiary question: why is the spacing after the `longtable` environment greater than the spacing before? By default, both lengths `\LTpre` and `\LTpost` are defined as equal to `\bigskipamount`, in the `longtable` package.


title: string manipulation and catcodes

text: I want to detect whether an input line contains a certain substring, similar to the problem discussed here: Check if a string contains a given character The complicating problem is that the match strings look like these:               %* tex 1;     %* pgm 4;      The first step is to find whether I have a match. I'm trying to do this using the `xstring` package. The following code is my attempt to get started, just to test whether the string contains a `%` sign. It complains that the paragraph ended before `\x` was complete.               \begingroup       \catcode`\%=12\relax       \def\x#1{\def\dotest{\catcode`\%=12\relax\IfSubStr{#1}{%}{YES}{NO}}}       \expandafter\endgroup\x      The complete task is to read a line and:   1. find whether there is match,    2. what type it is (tex or pgm) and    3. read the trailing number into a counter   4. possibly pass the line to a verbatim environment or external file. Basically I'm constructing a mini-language to be used as a code environment.


title: changebar in ToC in LaTeX

text: Is it possible to put the change bars (in a LaTeX doc) in table of content of the individual sections? e.g I have some changes in section 4.3.1 and `O` would like to have change bar in the table of contect in section 4.3.1 also.


title: Extra comma at the end of a reference

text: I am having a problem that whenever I have more than one entry with the same "author", then in my bibliography, both of them will have an extra comma at the end. Could you show me how to get rid of them Here are exemples of the entries ![enter image description here](http://i.stack.imgur.com/479zV.png) And here is the results ![enter image description here](http://i.stack.imgur.com/nfSC2.png) As suggested, here is my latex files                % Set up the document         \documentclass{book}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn              % Include any extra LaTeX packages required         \usepackage[square, numbers, comma, sort&compress]{natbib}  % Use the "Natbib" style for the references in the Bibliography         \usepackage{verbatim}  % Needed for the "comment" environment to make LaTeX comments         \usepackage{vector}  % Allows "\bvec{}" and "\buvec{}" for "blackboard" style 6         \usepackage{amssymb}          \usepackage{caption,sansmath}         \usepackage{multirow}          \usepackage{soul}         \usepackage{fancyhdr}         \usepackage{pdfpages}         \usepackage{hyperref}         \usepackage{pgfplots}         \usepackage{tabularx,ragged2e,booktabs,caption}              %Fixing many float unprocessed         \usepackage[section] {placeins}                   \usepackage[T1]{fontenc}    %COMMENT OUT THE FONT         %\usepackage[bitstream-charter]{mathdesign}         \usepackage[expert]{mathdesign}              \usepackage{textcomp}         \usepackage{charter}                        \begin{document}              Two problems. One is that if two references have the same author, there is an extra comma at the end of those reference \cite{Ackermann01}. Now I cite another whose author is the same with the previous - Please have a look at the bibliography the \cite{Ackermann02}.                     Another one with different author \cite{Safari}                   \label{Bibliography}         \lhead{\emph{Bibliography}}  % Change the left side page header to "Bibliography"         \bibliographystyle{unsrtnat}  % Use the "unsrtnat" BibTeX style for formatting the Bibliography         \bibliography{Bibliography}  % The references (bibliography) information are stored in the file named "Bibliography.bib"              \end{document}  % The End      And here is my bibliography file,               @unpublished{Safari,             author = "Rollin Safari",             title = "A hunt",             note = "Available at \url{www.rollin-wild.com/}. Last accessed on May 1$^{st}$ 2013"}             @unpublished{Ackermann01,             author = "Pascal Ackermann",             title = "Lady {F}inwe",             note = "Available at \url{http://pascal.ackermann.free.fr/}. Last accessed on May 1$^{st}$ 2013"}             @unpublished{Ackermann02,             author = "Pascal Ackermann",             title = "Fille {F}leur",             note = "Available at \url{http://pascal.ackermann.free.fr/}. Last accessed on May 1$^{st}$ 2013"}


title: Exsheets: improve subquestions scores features using tasks

text: I have a question that is composed by several subquestions (which is done using `tasks`). I also want to have a table at the end where I have the score for each question. The questions are as follows: (1) As you can in the MWE, in the final table only appears the score for questions and not subquestions, is there a way to make all them appear? (2) Also I need to manually sum the values of subquestions and put it in the questions environment (otherwise it would not appear and be summed in the final table), is there a way to grab the score for each subquestion making it appear in the main question? (3) I am using `marginnote` to put the score as a side note; and I not very happy with that, is there any `exsheets` mechanism to do it better (e.g., like the headings for questions)?               % arara: pdflatex     % arara: pdflatex     % arara: clean: { files: [ main.aux, main.log, main.out ] }     % arara: preview          \documentclass[10pt,a4paper]{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{lmodern}     \usepackage[pass,showframe]{geometry}          \usepackage{array}          \usepackage{blindtext}          \usepackage[load-headings]{exsheets}     \SetupExSheets{%         solution/print=true,         headings=block-wp,     }          \settasks{label=qu.tsk}          \usepackage{marginnote}          \begin{document}          \begin{question}{3.5}          \begin{tasks}     \task \marginnote{\points{1}}%     \blindtext          \task \marginnote{\points{0.5}}%     \blindtext          \task \marginnote{\points{1}}%     \blindtext          \task \marginnote{\points{1}}%     \blindtext     \end{tasks}          \end{question}          \null\vspace*{\fill}     \begin{center}     \begin{tabular}{|l| *{\numberofquestions}{c|} c|}\hline     Question & \ForEachQuestion{\QuestionNumber{#1}\iflastquestion{}{&}} & Total \\\hline     Points & \ForEachQuestion{\GetQuestionProperty{points}{#1}\iflastquestion{}{&}} & \pointssum* \\\hline     Notes & \ForEachQuestion{\iflastquestion{}{&}} & \\\hline     \end{tabular}     \end{center}     \end{document}


title: Alignment rules

text: I find myself quite frequently in the need to check whether some elements on my page are aligned exactly as intended. As a result, I usually end up magnifying the output 400% and using a rule over my screen... Needless to say, I would much rather be able to draw up "alignment rules" from within (La)TeX, but have failed so far to produce an elegant solution. So here is a challenge for people smarter than me, whose result will probably be useful to people more lazy than me :) Implement "alignment rules" that:   * Extend either horizontally or vertically (2 different commands) from anywhere the commands are issued,   * Extend in both directions up to the page borders,   * Do not interfere with the layout of the page,   * Are displayed in a distinctive color (red), and   * Optionally, provide can be moved up/down (for horizontal alignment rules) or left/right (for vertical alignment rules) by a given distance.


title: 3D figure with pst-3Dplot

text: I'm trying to plot a simple math function in 3D using the package `pst-3dplot`. The function is `z = 1/(1+a*exp(-b*y)) * (c * (1 - exp(d*x)) * (1 - exp(e*(x-f))))`. I tried the following:               \def\PsEuler{2.71828182846}     \psset{xunit=0.5cm,yunit=0.5cm}     \begin{pspicture}(-5,0)(10,10)         \psset{Beta=15,nameX=$x_1$,nameY=$x_2$,nameZ=$x_3$}         \pstThreeDCoor[IIIDticks,IIIDlabels,xMin=0,xMax=120,yMin=0,yMax=1,zMin=0,zMax=12,Dx=1,Dy=0.01,Dz=1]         \infixtoRPN{ 1/(1+300*\PsEuler^(-10*y)) * (11.06 * (1 - \PsEuler^(-0.214*x)) * (1 - \PsEuler^(0.02667*(x-113)))) }         \psplotThreeD[yPlotpoints=50,xPlotpoints=50,hiddenLine=true](0,120)(0,1){\RPN}     \end{pspicture}      The function is correctly shown between [0,1] on the y-axis, but I didn't succeed in streching the y-axis. I have 10 units in both the x-z axis and 1 unit in the y-axis and the function looks like very "crushed" in this direction. I tried the `Dy = 0.1` in order to "strech" the y-axis and plot 10 units of values `0.1`. It doesn't work. If I set               \psplotThreeD[...](0,120)(0,10){\RPN}       it plots the function on the y-axis from 0 to 1 (step 0.1) but the function is not correctly drawn (in fact the result is the function between [0,10] in the y-axis but with an incorrect y-scale). I double checked the function with Matlab and it is correctly plotted. Any suggestions would be greatly appreciated.


title: Using \only in beamer presentation

text: I have the following code for a slide from a presentation:               \begin{frame}     \frametitle{Heuristic Policies}     \begin{columns}          \column{0.5\textwidth}     \begin{itemize}     \item<1-> These are methods aiming to give a good but not necessarily optimal solution to a problem.     \item<2-> There exist a number of such policies for bandit problems.     \only<1-9>{     \item<3-9> Greedy policy:     \begin{itemize}     \normalsize     \item<4-9> choose arm with greatest expected reward     \item<5-9> ignores variability in prior distribution     \item<6-9> quite good for Bernoulli bandits, but less effective for normal bandits     }     \end{itemize}          \end{itemize}               \column{0.3\textwidth}          \vspace{-25pt}     \uncover<7->{\begin{figure}     \begin{center}     \includegraphics[height = 2.7cm, trim=-1cm 0cm 0cm 0cm,clip=true]{bandit.jpg}     \caption*{$(\alpha,\beta) = (1,1)$}     \end{center}     \end{figure}}     \vspace{-25pt}     \uncover<8->{     \begin{figure}     \begin{center}     \includegraphics[height = 2.7cm, trim=-1cm 0cm 0cm 0cm,clip=true]{bandit.jpg}     \caption*{$(\alpha,\beta) = (6,5)$}     \end{center}     \end{figure}}               \column{0.2\textwidth}          \uncover<7->{$\mu = \frac{1}{2}$}\\     \vspace{70pt}     \uncover<8->{$\mu = \frac{6}{11}$}\\     \only<9>{$\Rightarrow$ play this arm}               \end{columns}     \end{frame}      At the moment, it's doing what I want. However, the next step is to have it so that all of the bullets from "Greedy policy" are removed as well as "play this arm", and the bulleted text replaced by similar text formatted in the same way. However, I can't see to use \only to do what I want. I tried:               ...          \item<4-9> choose arm with greatest expected reward     \item<5-9> ignores variability in prior distribution     \item<6-9> quite good for Bernoulli bandits, but less effective for normal bandits     }     \end{itemize}          \only<10-16>{     \item<10-16> Next policy:     \begin{itemize}     \normalsize     \item<11-16> comment 1     \item<12-16> comment 2     \item<13-16> comment 3     }     \end{itemize}          \end{itemize}          \column{0.3\textwidth}          ...      but this didn't work. Could anyone show me what I'm doing wrong? Thanks.


title: Stack margin text in outer margin in ConTeXt Mk IV

text: I try to stack marginals with ConTeXt Mk-IV. In this question a possible solution was given. The solution works fine, but it turns out that the `location=outer` parameter does not work any more. Please consider the following example:               \setupinmargin[stack=yes,location=outer]          \starttext           text text\margintext{this is a note.} text text\margintext{Another note.}          \input knuth           text text\margintext{this is a note.} text text\margintext{Another note.}          \input knuth           text text\margintext{this is a note. Now longer.} text text\margintext{Another note.}          \input knuth           \stoptext       It works fine in Mk-II (which is not an option for me). It disregards `location=outer` in Mk-IV. If I replace now the `\margintext` macros with `\inouter`, it breaks the stacking in Mk-IV, but works in Mk-II. Is there a solution that allows stacking, but keeps the marginals in the outer margin?


title: How do I prevent duplicate Glossaries section title when redefining page styles in Memoir class?

text: The solution provided to question How to modify Memoir class' headers/footers without redefining everything involves a) redefining the Memoir headings and b) redefining page styles. The latter seems to cause a new problem to appear: I now have two "Glossary" sectional titles when using Glossaries. Here is the MWE:               \documentclass{memoir}           \usepackage{lipsum}          %-----------------------------     \copypagestyle{headingsnobook}{headings}          \makeevenhead{headings}%     {\slshape\leftmark}{}{\thepage}     \makeoddhead{headings}{\rightmark}{}{\thepage}     \makeevenfoot{headings}{}{}{}     \makeoddfoot{headings}{}{}{}          \copypagestyle{plainnotice}{plain}     \makeevenfoot{plainnotice}{}{}{\thepage}     \makeoddfoot{plainnotice}{}{}{\thepage}     \aliaspagestyle{chapter}{plainnotice}          \makeevenhead{headingsnobook}{\leftmark}{}{\thepage}      %-----------------------------          \usepackage{glossaries}     \makeglossaries     \newglossaryentry{test}{%     name={test},     description={A test}}          \begin{document}          % Backmatter     \backmatter      \pagestyle{headingsnobook}          \glsaddall     \printglossaries          \end{document}      Commenting-out the code between the dotted lines as well as `\pagestyle{headingsnobook}` makes the duplicate title disappear, but I need this code to eventually add Book XX and Part XX to mainmatter headings, but not to backmatter headings, such as in glossaries or indexes. Can the "headingsnobook" page style be defined so as to avoid this?


title: Fake small caps with XeTeX/fontspec?

text: Using XeTeX and `fontspec`, I use the Liberation font family in of my documents. Unfortunately those fonts (esp. Liberation Serif) do not natively support small caps. Is there a way to enable fake small caps in `fontspec`?


title: Embed text in pgfplots or tikz generated pdf files

text: I generate data plots in my LaTeX documentation using a combination of TikZ and `pgfplots`. Many of the plots are generated using script files which can also include the raw data if data is being plotted. Is there anyway to embed the script files in the plot itself (these could be `pgfplots` scripts or python code etc)? The idea is that if someone obtains the pdf file they can extract the script and/or data that actually generated the plot and therefore will be able to reproduce the figure themselves and have at hand the original data that was used. I saw the message on `pdfcomment` and it looks very promising. Would `pdfcomment` be a good way to embed text in plots or are other other possible approaches? A comment on those who might suggest why not just supply the raw LaTeX file. These documents get submitted to journals, archives (e.g. arXiv) and other repositories where the raw LaTeX file cannot usually be included with the submission.


title: How to center two custom defined layout elements on a row?

text: So I am limited via some style doc on how image elements with captions look like: some code like in here does what they do:               \renewcommand{\@makecaption}[2]{%     \abovecaptionskip=-5pt     \belowcaptionskip=-27pt     \vspace{\abovecaptionskip}%     \sbox{\@tempboxa}{{\footnotesize {\textbf{#1.}} #2}}     \ifdim \wd\@tempboxa > \hsize         \begin{center} {\footnotesize {\textbf{#1.}} #2} \par \end{center}     \else         \global\@minipagefalse         \hbox to \hsize {\footnotesize \hfil{\textbf{#1.}} #2\hfil}%     \fi     \vspace{\belowcaptionskip}}          \newcommand{\Figure}[3]{\begin{figure}[h]\begin{center}\includegraphics[width=#1]{#2}\caption{#3\vspace{ 1cm}}\end{center}\end{figure}}          \newcommand{\WrapFigure}[5]{\begin{wrapfigure}[#1]{l}{#2}     \includegraphics[width=#3]{#4}\caption{#5}     \end{wrapfigure}\vspace{0.3cm}}          \newcommand{\WrapFigureR}[5]{\begin{wrapfigure}[#1]{r}{#2}     \includegraphics[width=#3]{#4}\caption{#5}     \end{wrapfigure}\vspace{0.3cm}}      I want to place 2 images with captions like in here: ![enter image description here](http://i.stack.imgur.com/3UNSO.jpg) I tried this:               \begin{center}     \begin{array}     \Figure{0.6\textwidth}{d2.eps}{ ~ \label{fig4}} &     \Figure{0.6\textwidth}{d1.eps}{ ~ \label{fig5}}      \end{array}     \end{center}      But failed. So how to make two custom image layout elements live in one row?


title: Going "back" when using hyperref

text: I'm including `\usepackage{hyperref}` so that each instance of `\ref` (as well as each page number in the index and the table of contents) automatically links to that page. When I'm viewing the document (in `Sumatra`) and I click a link, I jump to the linked page. Is there any easy way to go "back" to where I was before I clicked the link? (And is the answer any different when using Adobe Acrobat reader?)


title: How can I get spacing between paragraphs while also keeping the default indentations?

text: I'm using the report documentclass, and the paragraph formatting looks something like this with two paragraphs:               Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ac odio est.     Morbi vel turpis ipsum.         Pellentesque ac ultricies mauris. Vivamus turpis dui, congue a hendrerit     vitae, accumsan  id nulla. Proin laoreet est id est tempor commodo.      However I would like to have:               Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ac odio est.     Morbi vel turpis ipsum.              Pellentesque ac ultricies mauris. Vivamus turpis dui, congue a hendrerit     vitae, accumsan  id nulla. Proin laoreet est id est tempor commodo.      I have tried the `parskip` package, which added the spacing between the paragraphs I'm looking for, but it also removed all of the indentations.


title: How to center spine text with zwpagelayout

text: I am trying to use `zwpagelayout` to create a cover that I can use with CreateSpace. So far, I have almost everything working, but there is one problem.               \documentclass{article}     \usepackage[papersize={,10.5in},spine=1in,cropmarks,textwidth=7in,leftmargin=0in,nopagenumbers,color]{zwpagelayout}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[counterclockwise]{rotating}     \usepackage{graphicx}     \begin{document}     \pagestyle{empty}     \hbox to \textwidth{%       \vbox to \textheight{\hsize \UserWidth \centering     back cover     }\hss       \vbox to \textheight{\hsize \CropSpine \centering             \begin{sideways}\fontsize{30}{30}\selectfont \textbf{The Title Which is Long\hspace{1in} The Author}\end{sideways}             }\hss       \vbox to \textheight{\hsize \UserWidth \centering     \begin{center}          front cover          \end{center}     }\hss}     \end{document}      In the above, the spine looks fine as I have it, but if I try to add a logo with:               \includegraphics[width=1cm]{logo}      the whole spine shifts to the left and is no longer centered. In other words, replacing the line with `sideways` with:               \begin{sideways}\fontsize{30}{30}\selectfont \textbf{The Title Which is Long\hspace{1in} The Author}\end{sideways}text      doesn't do what I expect. How can I center some horizontal text below the author's name on my spine? Do I need to use minipages? The following replacement for the `sideways` line almost gets me where I need to be, but I had to manually try different options for the `put` command. Can that be automated?                       \begin{sideways}\fontsize{30}{30}\selectfont             \textbf{The Title Which is Long\hspace{1in}             The Author}             \begin{picture}(0,0)             \put(50,-14){\turnbox{-90}{cats}}             \end{picture}             \end{sideways}


title: Is it possible to draw an n by n grid with text in each cell, with a different background shade/colour in each? (confusion matrix)

text: I am making a confusion matrix for a document, and I was wondering if LaTeX has the capabilities to handle this. It is essentially a table, but with background shading corresponding to the value in the table (the shading could be hand-coded). How can this be done in LaTeX? Is it possible? An example is![http://i.stack.imgur.com/mLxlO.png](http://i.stack.imgur.com/gk3Ul.png)


title: Top right side page numbering

text: I want the numbers of pages to be placed at the top right side. I try to do it like this               \documentclass[12pt]{article}          \usepackage{fancyhdr}          \begin{document}     \lhead{}     \chead{}     \rhead{\thepage}     \lfoot{}     \cfoot{}     \rfoot{}          My text.          \end{document}      Numbers still remains like default - center of bottom. What do I wrong?


title: subfigure with memoir

text: I made an article and insert several subfigures in that as follows:               \begin{figure}         \centering         \begin{subfigure}[b]{0.3\textwidth}                 \includegraphics[width=\textwidth]{fig6_1}                 \caption{Increase}         \end{subfigure}%         \begin{subfigure}[b]{0.3\textwidth}                 \includegraphics[width=\textwidth]{fig6_2}                 \caption{Increase}         \end{subfigure}         \begin{subfigure}[b]{0.3\textwidth}                 \includegraphics[width=\textwidth]{fig6_3}                 \caption{Increase}         \end{subfigure}         \caption{Round}     \end{figure}      But, when I copy the same code to my thesis file, it turns out errors > Command \subcaption already defined. > ...ubcaption{\captionsetup{subtype*}\caption} I compile my file with `xelatex` in command prompt, it gives a warning error that > Class memoir Warning: You are using caption package with the memoir class. > This may cause unexpected or inconsistent results if you use any of the > memoir's captioning facilities. While compiling, it stops with error >  ! LaTeX Error: Command \subcaption already defined. Or name \end... > illegal, see P.192 of the manual. But, there is no page 192 in the `caption` guide on CTAN. I checked the thesis class file and observed use the of `memoir`. What change should I have in my code or class file code to make it functional?


title: Acronym upper/lower/mixed case, and pluralisation

text: My question is really a further question of this post. I've used the following code from there in my tex doc.:                   \documentclass{article}         \usepackage{acronym}         \usepackage{etoolbox}         \makeatletter         \newif\if@in@acrolist         \AtBeginEnvironment{acronym}{\@in@acrolisttrue}         \newrobustcmd{\LU}[2]{\if@in@acrolist#1\else#2\fi}              \newcommand{\ACF}[1]{{\@in@acrolisttrue\acf{#1}}}         \makeatother              \begin{document}         \begin{acronym}         \acro{SRS}{\LU{S}{s}patial \LU{R}{r}eference \LU{S}{s}ystem}         \acro{DC}{\LU{D}{d}irect \LU{C}{c}urrent}         \end{acronym}              Batteries run on \ac{DC} and \ac{SRS} are different things.         \end{document}      This works great. But what happens if you would normally want the acronym lower case but, since it appears at the start of a sentence, you want only the first letter of the first word to be capitalised? I'm now using the same code fragments as above, but when I start the sentence with:               \ac{dc} lorum impsom...      It gives me:               direct current lorum impsom...      instead of:               Direct current lorum impsom...      Is this an easy fix? FYI, I've already tried `\Ac{}` or `\Acp{}` but they didn't work. I suspect I need to create a new command, but I don't know how, which is why I'm coming to you lovely people. Further, I'm having issues with pluralisation. If I want to pluralise something, I would normally use the `\acp{}` command. However, if I want capitals AND pluralisation, `\ACP{}` doesn't work.


title: cleveref counter and ref label number format with padding zeroes

text: I am using `cleverref` and a custom counter to typeset a special kind of reference, where I need the same text on the definition side and the reference side. Currently I use `\textbf{F\arabic{thefeatures}}` on the definition side and `\crefformat{thefeatures}{#2\textbf{F#1}#3}` to format the references. However instead of the `F<number>` I'd like to switch to `F<number padded by zeroes>`. While I can use the `fmtcount` package for the definition side (and use the `\padzeroes` command with decimal output), this doesnt work for the reference labels. Current code:               \documentclass{article}     \usepackage{cleveref}          \newcounter{thefeatures}     \setcounter{thefeatures}{0}          \crefname{thefeatures}{feature}{features}          \newcommand{\deffeat}[1]{         \refstepcounter{thefeatures}         \label{#1}         \textbf{F\arabic{thefeatures}}     }          \crefformat{thefeatures}{#2\textbf{F#1}#3}               \begin{document}          \deffeat{test} feature test               \deffeat{test2} feature test2               \Cref{test} test ref          \end{document}


title: Generating fonts of all LaTeX math symbols

text: ## Admission of Confusion Clearly I'm confused, I'll update the question as best as I can as people point out my lack of understanding. ## Ultimate Goal I like the fonts that pdfLaTeX uses to create documents. I especially like the symbols in ftp://tug.ctan.org/pub/tex- archive/info/symbols/comprehensive/symbols-letter.pdf. I don't know how these fonts are created. However, I would like to have them as ttf (or some other format easily usable in my own applications). I have heard that metafont is related to this (supposedly it's a way to generate fonts). However, as pointed out, metafont is bitmap, whereas ttf is vector. ## Question How do I generate a ttf (or something similarly usable) for the various math symbols used in ams math? ## More possible points of confusion Given that pdfLaTeX can produce a pdf file that contains the ams math symbols. I assume (perhaps I'm way off here) that there has to be some way to produce ttf fonts of the ams math symbols. Thanks!


title: Customize minitoc

text: I'm writing my thesis and I woud like to add a minitoc at the beginning of each chapter. However, I don't like the standard format where the titles of the sections are listed as in the main TOC and I would like to align the titles on the same row (a format I saw in several books), maybe sperated by a comma or a textbullet. I mean something like this: > Chapter 1 > > Contents > > 1.1 Sec 1, 1.2 Sec 2, 1.3 Sec3, 1.4 Sec 4 I can do this for the main TOC through the titletoc package, but I need it for minitoc. Is there a way to have this customization of the minitoc? Thank you in advance.


title: Aligning graphical elements with flowfram

text: ![enter image description here](http://i.stack.imgur.com/yY5tg.jpg)I'm new to Latex! I've have successfully managed to get my text in the right format, but am having problems positioning a single graphic where it needs to go. Essentially it should be on the left hand side of the page with the left frame text on top of it. However it's not quite working out. Just in case you need to know, symbol_strip is an image that's 4 x 20cm; I've commented it out as it'll just appear in the wrong place.               % Left frame     \begin{figure}     \hfill     % \includegraphics{symbol_strip.jpg}     \vspace{-2cm}     \end{figure}     \begin{flushright}          Tractor beat trailer give backwoods hee-haw gold frogskin plumb nugget. Liniment fancy rightly work chicken what cipherin' how ya. Heapin' backwoods her hospitality em got creosote overalls rodeo up. Townfolk soap out.          \end{flushright}\normalsize     \framebreak      And, yes, I'm using Hillbilly as my Lorem ipsum is rusty ;) I also tried using the example here syntax similar to \centering for right and left? by wrapping figure around flushright, only this time the text disappeared. Confused.               \documentclass[a4paper,11pt,final]{memoir}          \pagestyle{empty}          \usepackage{flowfram}     \usepackage{graphicx}            % left frame     \newflowframe{0.2\textwidth}{\textheight}{0pt}{0pt}[left]       \newlength{\LeftMainSep}       \setlength{\LeftMainSep}{0.2\textwidth}       \addtolength{\LeftMainSep}{2\columnsep}     % right frame     \newflowframe{0.7\textwidth}{\textheight}{\LeftMainSep}{0pt}[main01]               \begin{document}          \begin{figure}     \begin{flushright}     \includegraphics{symbol_strip.jpg}     \vspace{-2cm}      Tractor beat trailer give backwoods hee-haw gold frogskin plumb nugget. Liniment fancy rightly work chicken what cipherin' how ya. Heapin' backwoods her hospitality em got creosote overalls rodeo up. Townfolk soap out.     \end{flushright}     \end{figure}          \end{document}      I've included an image as well. The blue dagger like part is the image in question.


title: LaTeX package to help diagram translation of one language to another

text: I am learning Turkish and wanted to work on translating some Turkish text to English with the help of TeX. I think it would be better suited for the job. Wondering if a package exists to help with what I want or if there was something close. Ideally, I would like a package that could render the following as the end result:                 home     to go        Eve    gidiyorum          -      -`----'          |      |  |          |      |  `- present progressive tense (first person - singular)          |      `- git->gid (t->d) sound change ending          `- dative case ending for gitmek             I want to go home       Second example:                  home     to go        Eveniz  gidiyoruz          -`-'    -`----'          | |     |  |          | |     |  `- present progressive tense (first person - plural)          | |     `- git->gid (t->d) sound change ending          | `- possessive suffix (second person - plural)          `- dative case ending for gitmek           We are going to your home       Third example:               German  class  to buy; to get;    to continue                     to take, receive      Almanca dersi       almaya       devam ediyorum                  -         `--'              -`----'                  |          |                |  |                  |          |                |  `- present progressive                  |          |                |     tense (first person -                  |          |                |     singular)                  |          |                `- devam et->devam ed (t->d)                  |          |                   sound change ending                  |          `- verbal noun -mA, dative for devam etmek                  `- accusative case ending for almak              I want to continue taking German class      The "-" and "`--'" are horizontal curly braces.


title: /ActualText in small cap hyperlinks

text: I'm using the `frenchlinks` option for hyperref, which due to solicitous care of XeLaTeX + Linux Libertine, gives _bona fide_ small-caps links on the page. The problem is, when I cut and paste out of the generated PDF, I get Unicode small-caps out, whereas I'd prefer ASCII. Can anyone suggest how to modify this MWE? (Did I make a mistake in the setup?) _Note, for the updated MWE, I've tried to patch`\href` using the accepted answer from_ Patching arguments inside a macro (no dice). **Updated MWE**               \documentclass[article, a4paper, 12pt, oneside]{memoir}          \usepackage{xunicode}     \usepackage[MnSymbol]{mathspec}     %\defaultfontfeatures{Mapping=tex-text}          \setmainfont[Mapping= tex-text,            SmallCapsFont={Linux Libertine O},             SmallCapsFeatures= {Color=FFFFFF, RawFeature={+smcp,+hlig,+dlig}},             BoldFont={Linux Biolinum O Bold},        %     BoldFeatures={Color = FFFFFF,SmallCapsFont={Linux Libertine Capitals O Bold},%     %       SmallCapsFeatures = { Color=FFFFFF,   RawFeature={+smcp,+hlig,+dlig}} },            ItalicFont={Linux Libertine O Italic},             ItalicFeatures={Color = FFFFFF,  %            SmallCapsFont={Linux Libertine Capitals O Italic}, %            SmallCapsFeatures = {Color=FFFFFF}},             BoldItalicFont={Linux Biolinum O},             BoldItalicFeatures={ Color = FFFFFF, %           SmallCapsFont={Linux Libertine Capitals O Bold Italic},  %           SmallCapsFeatures = { Color=FFFFFF,RawFeature={+smcp,+hlig,+dlig}}} ]{Linux Libertine O}           \usepackage[linktoc=all,frenchlinks,pdfborderstyle={/S/U/W .5},citebordercolor={1 1 1},linkbordercolor={1 1 1},urlbordercolor={1 1 1}]{hyperref}          \usepackage{xstring}     \usepackage{accsupp}          \usepackage{etoolbox}     \catcode`\#=12     \newcommand{\newhref}{%     \normalexpandarg%     \patchcmd{\href}{#2}{%      \BeginAccSupp{method=pdfstring,ActualText={#2}}%      #2%      \EndAccSupp{}%     }{}{}%     }     \catcode`\#=6          \begin{document}          Sexy tex: \newhref{http://tex.stackexchange.com}{sxe}.          \end{document}      **Original MWE**               \documentclass[article, a4paper, 12pt, oneside]{memoir}          \usepackage{xunicode}     \usepackage[MnSymbol]{mathspec}     %\defaultfontfeatures{Mapping=tex-text}          \setmainfont[Mapping= tex-text,            SmallCapsFont={Linux Libertine O},             SmallCapsFeatures= {Color=FFFFFF, RawFeature={+smcp,+hlig,+dlig}},             BoldFont={Linux Biolinum O Bold},        %     BoldFeatures={Color = FFFFFF,SmallCapsFont={Linux Libertine Capitals O Bold},%     %       SmallCapsFeatures = { Color=FFFFFF,   RawFeature={+smcp,+hlig,+dlig}} },            ItalicFont={Linux Libertine O Italic},             ItalicFeatures={Color = FFFFFF,  %            SmallCapsFont={Linux Libertine Capitals O Italic}, %            SmallCapsFeatures = {Color=FFFFFF}},             BoldItalicFont={Linux Biolinum O},             BoldItalicFeatures={ Color = FFFFFF, %           SmallCapsFont={Linux Libertine Capitals O Bold Italic},  %           SmallCapsFeatures = { Color=FFFFFF,RawFeature={+smcp,+hlig,+dlig}}} ]{Linux Libertine O}           \usepackage[linktoc=all,frenchlinks,pdfborderstyle={/S/U/W .5},citebordercolor={1 1 1},linkbordercolor={1 1 1},urlbordercolor={1 1 1}]{hyperref}          \usepackage{xstring} % added as suggested in 1st given answer     \usepackage{accsupp}          \let\hrefold\href     \newcommand*{\hrefnew}[2]{%     \normalexpandarg%     \BeginAccSupp{method=plain,unicode,ActualText={#2}}%     \hrefold{#1}{#2}%     \EndAccSupp{}%     }          \begin{document}          Sexy tex: \href{http://tex.stackexchange.com}{sxe}.          \end{document}


title: How to rotate a table?

text: I have a table and I want to rotate it. The table has 3 rows and 4 columns, and I want to rotate the text inside this table as well. How can I do this?


title: Reduce number of fonts used (from default settings)

text: Why does the default LaTeX setting of `\usepackage[T1]{fontenc}` use so many different fonts (e.g. `\mathrm{}` uses a different font than `\textrm{}`)? At least the Adobe Acrobat Reader shows me a list that contains:   * CMBX10,   * CMEX10,   * CMMI...,   * CMR...,   * CMSY...,   * F108,   * F109,   * SFBX...,   * SFRM...,   * SFSL1000,   * SFTT1000 Can I reduce the number of fonts used in a document? Why are there so many fonts (even of the same family)?


title: How to import a txt full of symbols into LaTeX

text: I have a txt file that I want to import it into LaTeX. How can I import the txt file without changing its format? In particular, the txt doc has a lot of symbols (it is the output of other programs), so LaTeX must ignore those symbols..is there any way to do this? psd: My current solution is to convert txt to pdf, and then to import the Pdf into the LaTeX.


title: How to avoid getting "` when typing " in TeXnicCenter?

text: > **Possible Duplicate:**   >  Is there a reason shift+' writes " ' instead of just "? I'm using Windows 7 with TeXnicCenter 1.0 stable release candidate 1. I changed my keyboard from US-international to US, because this means a `^` gets immediately displayed when typing. But now, when typing `"`, I get ``"`, which it quite irritating in BibTeX. What is happening, and how to prevent it?


title: Discontinuating subenvironment in {philex}

text: I have to print a example in two parts with `philex`, like the following :               (1) a. First line          Some text.          (1) b. Second line         c. Third line.      It does not look very hard to do, so I bet I'm missing an obvious feature. I guess I should use the `\lbu`command for the sub-environment, but I can't find any way to achieve this. Here is what I did so far :               \documentclass{article}     \usepackage{philex}          \begin{document}          \lb{start}{     \lba{first}{First line}}     Some text.     \lbu{next}{start}{}{       \lba[b]{second}{Second line}       \lbb[c]{third}{Third line}}     Some text.     \lbu{}{start}{}{       \lba{second}{Second line}       \lbb{third}{Third line}}          \end{document}      Whether the letters start again from a instead of continuing from b, or the punctuation is not coherant.


title: Can I use both of setbuilder notations in one article?

text: There are two setbuilder notations, the vertical bar and the colon. In some cases, it is better to make a choice. For example, compare               \{f \mid f\colon M \rightarrow N \text{ is continuous}\}      and               \{f : f\colon M \rightarrow N \text{ is continuous}\}.      Also,               \{x : \lvert x \rvert = 1\}      and                \{x \mid \lvert x \rvert = 1\}.      But I feel uneasy because I was not consistent with the notation. Is it OK if I use both of them in one article?


title: Excluding every nth row in pgfplotstable

text: I need to exclude every 0th, 3rd, 6th ... row from a table. `\pgfmathparse{Mod(#1, 3) == 0}` did not work inside `row predicate/.code={}`, it gives following error:               ! Package PGF Math Error: Sorry, the operation 'Mod' has not yet been implemented in the floating point unit :-( (in 'Mod(0, 3) == 0').      I have copied following MWE from another question. I want to exclude rows according to their indices, not according to their values.               \documentclass{minimal}     \usepackage{pgfplotstable}     \begin{document}     \pgfplotstableread{       num       value       1         2       2         5       1         3       3         2       1         4       2         1     }\data     \pgfplotstabletypeset[row predicate/.code={%       \ifnum\pgfplotstablegetelem{#1}{num}\of{\data}=1\relax       \else\pgfplotstableuserowfalse\fi}]{\data}     \end{document}


title: \import and \includegraphics with macros: Preserving local path at macro definition time

text: I have been banging my head on this problem for a few days, trying many combinations of `\def`, `\edef`, `\noexpand`, `\expandafter`, etc. Say I have a module at `/tmp/module/` which contains `module.tex` and `image.png`. In `module.tex` I define a macro which, among other things, uses `\includegraphics` to pull in the image within this submodule with a relative path:               % module.tex     \newcommand{\myQuizHeader}[1]{       Quiz #1       \includegraphics[width=1.5in]{image.png}     }      And then from my main document I do an `\import` or `\subimport`, and then try to use the `\myQuizHeader` macro:               % main.tex     \documentclass[11pt,letterpaper]{article}     \usepackage{graphicx}     \usepackage{import}          \begin{document}       \import{/tmp/module/}{module.tex}       \myQuizHeader{27}     \end{document}      While import correctly prepends the module path in order to find files and images relative to the module while inside `module.tex`, those paths get removed when leaving the module, so the macros defined in that module don't work correctly anymore. When I call `\myQuizHeader{27}` from the main file the image is not found. What is the correct way to solve this? I tried playing tricks with saving the `\Ginput@path` variable to a local variable within the module, but then I got into `\edef` and `\noexpand` hell. Many thanks!