title: Using Linux Libertine fonts for math without newtxmath

text: I'm trying to use Linux Libertine as the math (and main) font, and I used this answer to set the math fonts. However, the math output is still CM.               \documentclass{minimal}        \usepackage{amsmath, mathspec, libertine, lipsum}     %\usepackage[libertine]{newtxmath}     \setmathsfont[ItalicFont={LinLibertine_RI.otf}]{LinLibertine_R.otf}     \setmathrm{LinLibertine_R.otf}     \setboldmathrm{LinLibertine_RB.otf}     \setmathsf{LinBiolinum_RB.otf}               \begin{document}     \lipsum[1]          \begin{equation}         \hat{Q}_i=\int_0^\infty \mathcal{G}^2(x) \Sigma^{-1}(x^2) f_i(x)dx     \end{equation}          \end{document}      ![enter image description here](http://i.stack.imgur.com/lgznU.png) If I try to uncomment the `newtxmath` line, I get an error > Package mathspec Error: `amsmath' must be loaded earlier than`mathspec' But I have loaded `amsmath` before `mathspec`! How do I fix these issues (fixing either is fine, since the goal is to use LL fonts for math). * * * As pointed out, moving `newtxmath` before `amsmath` solves the problem in the above MWE. Now let me change it a bit and include `amsthm` as well, which now leads to a host of other errors such as: > ! LaTeX Error: Command \openbox already defined. Or name \end... illegal, > see p.192 of the manual.


title: Caption package: bold numbering indents caption text - how to avoid that?

text: I ran across this problem and fail to find an answer even after thorough searching: I use               \usepackage[bf]{caption}        in my LaTeX document, as I want the "Figure 1"-Part of the caption to appear **bold**. Unfortunately, the following caption is indented starting on the second line, so that the "Figure 1" part is alone:               Figure 1: blabla, bla-                 blablabla               blabal               blablabla      I'd prefer sth like this (the other variant looks really stupid for narrow floats and wastes space):               Figure 1: blabla, bla-     blablabla blabla blabla      Has anyone found a solution for this?


title: LyX: Removing indentation from a table

text: I want to make a table that has terms on the left side with `.25\textwidth` and descriptions on the right side with `.75\textwidth` Like               Name:                    asdjoia     Position:                astronaut     ...:                     sadas      With the widths of the columns set, the table tends to be a bit on the right side of the paper though. I tried inserting a LaTeX argument for the table: `@{}ll@{}`, which indeed removes the indentation, but leaves me without the permanent width of the left side. The source of the table looks like this:               \begin{tabular}{@{}ll@{}>{\raggedright}p{0.25\textwidth}>{\raggedright}p{0.75\textwidth}}     Name: & asdjoia\tabularnewline     Position: & astronaut\tabularnewline     ...: & sadas\tabularnewline     \end{tabular}      And the related preamble code set to               \documentclass[danish]{article}     \setlength{\parindent}{0bp}     \providecommand{\tabularnewline}{\\}


title: Use flalign or alignat or align or similar environment to align to the left

text: The following is a small example to use `flalign` environment to generate equation.               \documentclass{article}     \usepackage{amsmath}     \usepackage{txfonts}          \begin{document}     The formula is:     \begin{flalign*}       \lambdaup &= \lambdaup_1 + \lambdaup_2\\     \end{flalign*}          \end{document}      The output aligns at the center:               The formula is                       lambda = lambda_1 + lambda_2      How can I make the alignment to the left, using `flalign`, `alignat` or `align` environment? I mean:               The formula is     lambda = lambda_1 + lambda_2      According to Michael's comment, adding option `[fleqn]` to package `amsmath` and setting `\mathindent=0.0pt` will solve the problem. But this will make all equations align to the left. How can I make the function `locally` to some environment instead of the whole article?


title: Getting front page title in the middle of the page when using \thispagestyle{empty}

text: For front page of the document I'm using `\thispagestyle{empty}`. But this command put the title on the very first row. I want to put the title in the middle to the page. I tried with `\vspace{50mm}` but it does not effect the behavior of `\thispagestyle{empty}`. Any help in this regard will be highly appreciated. Thanks


title: \sc not printed

text: I'm using the `\sc` command as `{\sc Tight}` but I can't see (on the monitor and when printed) it in acrobat reader but only with okular. Do you know why?


title: Reviews not same format as Articles in achemso

text: I'm submitting to ACS Nano using the `achemso` class. I use an external `.bib` file. Is it normal that the bibitems that are treated as `@Review` are not formatted the same as `@Article`? For the latter, it includes the journal name, while for the Review, it omits the journal and it puts the title italic instead... >   1. Geim, A. K.; Novoselov, K. S. The rise of graphene. _Nature Materials_ > 2007, _6_ , 183–191. >   2. Neto, A. H. C.; Guinea, F.; Peres, N. M. R.; Novoselov, K. S.; Geim, A. > K. _The electronic properties of graphene_ , 2009. > With the second being the review...


title: Show pageframe for LNCS article class

text: I'm trying to see the "text boundaries" of an LNCS document to check whether my floats fit, as the package pageframe offers to do. I can't get it to work, unfortunately.   * `\documentstyle[pageframe]{book}` wouldn't fit here, afaik since `\documentclass{llncs}` is how I should declare the document.   * `\documentclass[pageframe]{llncs}` seems to ignore it.   * `\usepackage{pageframe}` complains about `\paperheight` but I don't seem to be able to set that length. Has anybody managed to use this package or to otherwise have the text box of a LNCS document displayed ?


title: How to personalize \citeauthor command

text: I'm writing thesis using tuned `report` class, biblatex and biber for bibliography. `bib` file entries are generated by ScienceDirect export citation feature and style is czech-iso. For referring to some figure, graph or table I'd like to get this layout: > Image > > Caption > > From: 1st Author et.al.: Title [#]. and in bibliography > [#] 1st AUTHOR, 2nd AUTHOR, 3rd AUTHOR, Title,... For that purpose I use               \documentclass[a4paper,11pt%,draft%      ]{report}     \usepackage[french,english,czech]{babel}     \usepackage[utf8]{inputenc}     \usepackage{url}     \usepackage{float}     \usepackage{lipsum}     \usepackage[     backend=biber,     babel=other,     sortlocale=cs_CZ,     style=iso-numeric,     autocite=superscript     ]{biblatex}          \newcommand\foo[1]{\footnotesize{From: \Citeauthor{#1}: \citetitle{#1} \cite{#1}}}     \addbibresource{citace.bib}          \begin{document}     \lipsum[1]     \begin{figure}[H]     image     \caption{Text}     \foo{Yoshizawa:1993}     \end{figure}     \lipsum[2]     \printbibliography          \end{document}      but it returns: > 1st AUTHOR, 2nd AUTHOR,... : "Title" [#] How can I shorten the `\citeauthor` output without any effect to otput of `\printbibliography`?


title: Custom list of all paper in a .bib database

text: I want to list all papers in a bib database. However, the code `\nocite{*}` `\printbibliography[sorting=chronological, type={article}, title={\quad}, heading=subbibliography]` produces an extra line due to the `\quad`. What I want is a list of all papers **directly** under some text in the form of   * Paper 1 author & journal info abstract   * Paper 2 author & journal info abstract ... Can anyone enlighten me about how to achieve this? By the way, I used the code               \DeclareBibliographyDriver{article}{%       $\bullet$ {\bodyfont \printfield{title}%       \newblock%       \printnames{author}%       \par%       \newblock%       {%         %\footnotesize\addfontfeature{Color=lightgray}\itshape%         \usebibmacro{journal}%         , vol. \textbf{\printfield{volume}},        \setunit{\space}%         \printfield{pages}%         \newunit%         %\printlist{publisher}%         \setunit{\space}%         \printtext[parens]{\printfield{year}}%         %\newunit%       }}     \par     \newblock%     {     \quad\usebibmacro{abstract}     }       \par\vspace{1\baselineskip}     }     \DeclareNameFormat{author}{%       %\small\addfontfeature{Color=lightgray}%       \ifblank{#3}{}{#3\space}#1%       \ifthenelse{\value{listcount}<\value{liststop}}         {\addcomma\space}         {}%     }               \newcommand{\printbibsection}[1]{       \begin{refsection}         \nocite{*}         \printbibliography[sorting=chronological, type={#1}, title={\quad}, heading=subbibliography]       \end{refsection}     }          \DeclareSortingScheme{chronological}{       \sort[direction=descending]{\field{year}}       \sort[direction=descending]{\field{month}}     }


title: Why various syntaxes for various commands?

text: I understand that the standard syntax of commands in TeX is               \name[optional-1]…[optional-n]{argument-1}…{argument-n}      The `tabular` environment, however, apparently takes its optional arguments after the required arguments, while `item` and `hskip`/`vskip` have their arguments after a space and not grouped in any way. Why the inconsistency? Are there any more commands like `tabular`, `item`,a and the `skip`’s?


title: Is it possible write an 'ecv' class CV in another language?

text: I'm writing my CV. I use this template: `ecv` and there are two options `english` and `german`. Is it possible write in Portuguese?


title: How to prevent combining a character?

text: "EB Garamond" font combines `ʿ` character and the preceding letter. Consider following document:               \documentclass{article}     \usepackage{fontspec}     \setmainfont{EB Garamond}     \begin{document}             aʿ bʿ cʿ dʿ eʿ fʿ gʿ hʿ iʿ jʿ kʿ lʿ mʿ nʿ oʿ pʿ qʿ rʿ sʿ tʿ uʿ vʿ wʿ xʿ yʿ zʿ          \end{document}      ![enter image description here](http://i.stack.imgur.com/jObrB.png) How can I prevent combing `ʿ` (MODIFIER LETTER LEFT HALF RING) and the preceding letter? (In above images, only `b,d,i,j` are rendered correct.) **Update** After testing more than thirty, this is the only font has this issue. Unfortunately this is only suitable form for a paper that contains a lot of Unicode glyphs. ◕︵◕


title: Combining Document Classes

text: I have a complicated document containing files with a letter as the first document followed by several article type documents. I have done this by setting up a master tex file with all the frontpeice information, defining common style elements and whatnot, then adding the documents with \include statements. Is there a way to use the letter document class for the first file then switch to the article class for the rest of the files?


title: LuaLatex: Showing nonexisting errors

text: I am trying to use LuaLatex for printing plots (as PdfLaTeX doesn't have enough memory) but I have a problem with it. I am using TeXLive 2013 with TeXMaker. I was trying to compile a file once with LuaLaTeX and some errors were shown. I managed to compile that file using PdfLaTeX, however now that I need to use LuaLaTeX again, the same errors are shown with every file I am trying to compile, although they don't have any relation to the first file. I have tried deleting the `luatex-cache` folder from `C:\texlive\2013\texmf- var`, however the problem persists. Errors I got: > ! String contains an invalid utf-8 sequence. > \DeclareTextCompositeCommand{\"}{LGR}{ > > ! String contains an invalid utf-8 sequence. \accdialytika > \DeclareTextCompositeCommand The MWE:               \documentclass[10pt,a4paper]{report}      \usepackage[english,greek]{babel}      \usepackage[utf8]{luainputenc}           \begin{document}      \latintext{Hello!}      \end{document}


title: Cross reference between latex files

text: I am trying to get a tex file to read certain lines from a different text file. More precisely, in my database file $a.tex$ I have a long list. Now in a different file, I would like to have items with specific numbers. Of course, I can copy-paste. My question is, is there a way to get LaTeX to do it?


title: Chapterstyle Memoir: Picture on page left, chapter opening on page right

text: I am working on the layout of my dissertation and I would like to have the following design for all my chapter-openings:   * New chapters should always start on the left page, with a picturepage that contains only an illustration that spreads over the whole left page. Thus, there is no text on this page, only a large illustration. This whole page illustration is different for each chapter.    * On the page to the right of the picturepage (i.e., the next page), the normal chapter opening page with title, chapternumer, etc., should be. I have been trying a lot to achieve this, but I do not seem to get the picturepage on the page preceding the normal chapter opening. E.g., I tried to set the documentclass to openleft, but I did not succeed to include a picture on the left, and the chapteropening to the right. In the minimal example below, I have tried to use the `\part` as picturepage (let `\part` start on the left page, put picture on it, then let `\chapter` start on the right page). However, the picture does not display on the part page, but on the next page. Sorry if the latex code is not so neat, I just started to learn it. Thank you very much in advance. Minimal example:               \documentclass[10pt,showtrims,openright]{memoir}          \usepackage{eso-pic}     \usepackage{graphicx}     \usepackage{geometry}          \setstocksize{25cm}{18cm}     \settrims{0.5cm}{0.5cm}     \geometry{paperwidth=17cm, paperheight=24cm}     \setlrmarginsandblock{2.5cm}{2.5cm}{*}%%%%     \setulmarginsandblock{2.5cm}{3cm}{*}     \checkandfixthelayout          % To delete white page after part and put the picture on the part page     \renewcommand{\afterpartskip}{\vfil}               \begin{document}     \openleft       \part*{Prechappicturepage1}     \AddToShipoutPictureBG*{% Add picture to current page       \AtStockLowerLeft{% Add picture to lower-left corner of paper stock         \includegraphics[width=\stockwidth,height=\stockheight]{art/testimage.eps}}}     \openright           \chapter{Title ch1}%          \openleft     \part*{Prechappicturepage2}     \AddToShipoutPictureBG*{% Add picture to current page       \AtStockLowerLeft{% Add picture to lower-left corner of paper stock         \includegraphics[width=\stockwidth,height=\stockheight]{art/testimage.eps}}}          \openright         \chapter{Title ch2}%               \end{document}


title: Using current path position in coordinate calculation

text: I often find myself writing code like this:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}     \begin{tikzpicture}       \node (aNodeWithALongName) at (1,1) {a};       \node (bNodeWithALongName) at (1,-1) {b};       \node (c) at (0,0) {c};            \draw[->] (aNodeWithALongName) -- (aNodeWithALongName -| c);       \draw[->] (bNodeWithALongName) -- (bNodeWithALongName -| c);     \end{tikzpicture}     \end{document}      I'm drawing a path, and need to use the first point's position to compute the second point, and I would like to avoid repeating the `aNodeWithALongName`, like this for example:                 \draw[->] (aNodeWithALongName) -- (current -| c);       \draw[->] (bNodeWithALongName) -- (current -| c);      And more complex stuff:                 \draw[->] ($(aNodeWithALongName)!.5!(bNodeWithALongName)$) -- (current -| c);       \draw[->] (bNodeWithALongName) -- ++(0, 1cm) -- (current -| c);      Is there a syntax similar to that which I could use?


title: Prevent different font for equations and text

text: **Please see the edit 2 below first.**   I am just beginning to learn TeX and I am working on a document that is based off a template I found here.   I am specifying my bibliography in a separate `.bib` file and I am using MikTeX for Windows to build a PDF. The problem that I am facing is the font used by bibliography page becomes grainy if I zoom in on generated PDF document. This is not the case with rest of the document. Only the bibliography has this problem. What could be causing this?   I am using               \bibliographystyle{plain}     \bibliography{mybib}      and the name of my bib file is obviously `mybib.bib`. **EDIT 1**   Here's sample tex file that I am using:               \documentclass{jhwhw} % A4 paper and 11pt font size     \usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs     \usepackage[english]{babel} % English language/hyphenation     \usepackage{amsmath,amsfonts,amsthm} % Math packages     \usepackage[scientific-notation=true]{siunitx}     \usepackage{fancyhdr} % Custom headers and footers     \usepackage{graphicx}     \renewcommand{\footrulewidth}{0.4pt}     \fancyhead[L]{Author Name}     \fancyhead[C]{Homework Title}     \AtBeginDocument{\renewcommand{\bibname}{References}}     \title{Homework Title}     \author{Author Name} % Your name     \hypersetup{pdfborder = {0 0 0}}     \begin{document}     \maketitle % Print the title     %----------------------------------------------------------------------------------------     \problem{Problem Title}      <<Problem>>     \solution      <<Solution>>      %----------------------------------------------------------------------------------------     \bibliographystyle{plain}     \bibliography{mybib}     \end{document}      **EDIT 2**   Apparently this has nothing to do with bibliography and seems to affect anything outside `{equation}`. Take a look at screenshot below. The upper part is in equation whereas the lower is just text.   ![enter image description here](http://i.stack.imgur.com/kaV9n.png)


title: multicolumn in array environment

text: I want to create a matrix like the following in a math environment but i keep getting compile errors.               \begin{array}{c c c c}     \multicolumn{3}{c}{R} & P \\     0 & 0 & 0 & 1     \end{array}


title: LuaLaTeX — too high memory usage

text: I've recently made my project buildable under `LuaLaTeX`. This is a bibliography database project which uses `biblatex` and `biber` to compile the database to produce something about 66-paged pdf file. Now I'm experience some problems with memory usage: while I was using `pdflatex` memory usage was about 100M which is affordable, but with LuaLaTeX memory usage grows too fast (for the last time I've killed `lualatex.exe` when it was using 2G of RAM. Here is the some suspicious output: > can't allocate 402653184 bytes I wonder if this is OK and WHY is this OK. I can provide sources, if this is going to help. UPDATE: the problem may be with polyglossia, since I use `babel` under `pdflatex` and `polyglossia` undex `lualatex`. UPDATE: I was able to compile my project with biblatex + polyglossia + lualatex. Here is the log: https://gist.github.com/georgthegreat/7386134


title: Table of Equations

text: I've looked around for this, and haven't been able to find a satisfactory answer; How would one go about producing (automatically) a table of equations, just a numbered list of used equations, possibly linked to their position in the document, as say an appendix?


title: Latex : algorithm not display under correct section

text: I'm using the `algorithm2e` package to put algorithm in my `Latex` documents. In my document, I have something like this :               \section My algorithms     \subsection Algo 1     code for first algorithm     ...               \subsection Algo 2     code for second algorithm     ...          \subsection Algo 3     code for third algorithm     ...          \subsection Algo 4     code for fourth algorithm     ...      and so on. The problem is that when producing the PDF, some algorithm are correctly displayed under their subsection, and some are displayed on other pages, not under the right section. I get something like this :               1. My algorithms     1.1 Algo 1         pseudo code for algo 1          1.2 Algo 2         pseudo code for algo 2          1.3 Algo 3     1.4 Algo 4     ---------------- next page -----------         pseudo code for algo 3     ---------------- next page -----------         pseudo code for algo 4      [ **WARNING** : the following links are broken are _should_ be fixed by the OP] Here is the full Latex source code : http://www.filedropper.com/demo_1 Here is the PDF I get : http://www.filedropper.com/demo_2 Is there a way to make sure the algo will stick with its subsection ?


title: How to get the amount of theorems in a section

text: How can I get the number (i.e. amount) of theorems that appear in a particular section (or between any user determined beginning and end point) and display it in the document?


title: Missing Subsequent Citation?

text: [Preface: I'm certain this question has been posed before but I could not find a simplified example as described below. I did find other threads but regarding more complicated formatting....] With multiple citations I discover that the author is omitted after the initial citation. I seem to encounter this problem specifically with the Chicago style. In other words, alternative styles (i.e. `authoryear` with only `biblatex`) do not yield this problem. MWE as follows,               \documentclass{article}     \usepackage[authordate,backend=biber]{biblatex-chicago}     \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}          @Book{book,       author        = {Author},       title         = {Booktitle},       subtitle      = {Booksubtitle},       publisher     = {Publisher},       location      = {Location},       date          = {1995},     }          \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          First time \parencite[c.f.][38]{book}. Second time \parencite{book}.          \printbibliography          \end{document}      With the output being, > First time (c.f. Author 1995, 38). Second time (). While the desired result is obviously, > First time (c.f. Author 1995, 38). Second time (Author 1995). This result also occurs when using the `\autocite` command. Any thoughts or references to other threads in which the answer may be found would be greatly appreciated!


title: BibTex problem with multiple names in author field despite using "and"

text: I'm new to StackExchange! I have this document:               \documentclass[a4paper,12pt,oneside,italian]{book}     \usepackage[utf8]{inputenc}     \usepackage{url}          \begin{document}          Questa è una citazione \cite{Citation}.          \bibliographystyle{plain}     \bibliography{biblio}     \end{document}      And this bibliography:               @misc{Citation,     author = "Daniele Vietri and Francesca Castelli",     title = "M-commerce in Italia",     howpublished = {\url{http://www.dblog.it/ecommerce/}},     year = {2012},     note = {[accesso: Marzo 2013]}     }      Why do I get the following output? It's making me crazy... ![enter image description here](http://i.stack.imgur.com/6fVf8.png) I would like to have a comma in place of "and". And why the first letter of the word "Italia" in the title becomes lower-case?


title: Use glossary term in another entry

text: It may be useful to me to reference a glossary entry in another, as in               \documentclass[a4paper, 11pt, oneside, brazil]{book}          \usepackage[brazil]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          % \makeglossaries     % http://en.wikibooks.org/wiki/LaTeX/Glossary#Using_defined_terms     \usepackage[xindy,toc]{glossaries}          \begin{document}          \tableofcontents          \printglossary[type=main,style=altlist]          \newglossaryentry{firstterm}{         name={some first term},         description={first term description in here},         first={first version of first term},         long={long version of first term},         plural={plural version of first term},         firstplural={first plural version of first term}     }          \newglossaryentry{secondterm}{         name={some second term},         description={second term description in here,             which could use \gls{firstterm}},         first={first version of second term},         long={long version of second term},         plural={plural version of second term},         firstplural={first plural version of second term}     }          Then here is the text, where I can refer to my terms     normally, either by \gls{firstterm}, \gls{secondterm},     \gls*{firstterm} or \gls*{secondterm}.          \end{document}      The main point here is when I (wish I could) do               \newglossaryentry{secondterm}{         (...)         description={\gls{firstterm}**},         (...)     }      without the error               ./main.gls:<someline>: Package glossaries Error: Glossary entry `firstterm' has not been defined. [\glsXpageXglsnumberformat{}{8}}}]      Is there any way to do it?


title: How to italicize the heading and optional title of a theorem?

text: Consider the following code:               \documentclass{amsart}     \begin{document}          \makeatletter       \def\th@plain{       \thm@notefont{}       \itshape}     \makeatother          \theoremstyle{definition}     \newtheorem*{prop}{Proposition}          \begin{prop}[Optional Title]       Content.     \end{prop}          \end{document}      I want to italicize the (bold) heading and (normal) optional title of the sample theorem (proposition).


title: Using a tikz figure in an IEEE paper

text: I'm trying to include a `tikz` figure in a IEEE paper. I have the `IEEE.cls`, and `IEEE.bib` files in my current directory, but I can't seem to compile with `pdflatex`. I've used `tikz` successfully before, and I've followed my old examples, so I'm not sure what the problem is.


title: Global caption issue with table when using subcaption package

text: Firstly I apologize if this had been answered before. I have tried looking for it anywhere but I couldn't find any solution. Anyway, I have a trouble with the caption of my table when I included the subcaption package. This is the excerpt of the code:                   \documentclass{ifacconf}         \usepackage{natbib}         \usepackage{graphicx}         \usepackage{subcaption}              \begin{document}              \begin{table}[hb]             \centering             \caption{Test eheh blah}             \begin{tabular}{|c|c|c|c|} \hline                 \multicolumn{4}{|c|}{Margin settings} \\                 \hline                 Page & Top & Bottom & Left/Right \\ \hline                 First & 3.5 & 2.5 & 1.5 \\ \hline                 Rest & 2.5 & 2.5 & 1.5 \\ \hline              \end{tabular}         \end{table}              \end{document}      And the output is ![withSubcaption](http://imageshack.com/scaled/800x600/513/0o0l.jpg) However, if I removed the subcaption package, the output is as expected ![withoutSubcaption](http://imageshack.com/scaled/800x600/513/75c3.jpg) So, I would really appreciate any help. Thanks. Cheers. EDITED: Following Harish Kumar answer, although it does solve the caption issue in my table, it causes problem in the captions of my other subfigure. Here is the code of the subfigure.                   \usepackage{epstopdf}         \begin{figure}[htb!]             \centering             \begin{subfigure}{0.38\textwidth}                 \centering                 \includegraphics[width=\textwidth]{pic1.eps}                 \caption{test caption}                 \label{fig:pic1}             \end{subfigure}             \\             \begin{subfigure}{0.38\textwidth}                 \centering                 \includegraphics[width=\textwidth]{pic2.eps}                 \caption{test caption}                 \label{fig:pic2}             \end{subfigure}             \caption{Long caption Long caption.}             \label{fig:pictures}         \end{figure}      And the output ![subfigure](http://imageshack.com/scaled/800x600/534/7ufa.jpg)


title: Numbering theorems with page numbers

text: I want to number theorems by `(page number).(sequential in the page)`. So in page 6 I would have > Thm 6.1 AAAAAABBBVVV > > Thm 6.2 BBBGGSDFASFASF > > Thm 6.3 AXASDFASDF and then in page 7 it would be > Thm 7.1 AAAAAABBBVVV > > Thm 7.2 BBBGGSDFASFASF > > Thm 7.3 AXASDFASDF I tried using `\newtheorem{thm}{Thm}[page]`. However, if Thm 7.1 is at the top of page 7, sometimes it would get numbered as Thm 6.4. I assume that this happens because `\thepage` is called before the actual new page was set. Is there an easy fix for this?


title: Large number of plots from external csv file

text: I'm looking to draw a large number of lines/datasets (around 150~200, 50 points each) on a single window using pgfplot. The data is imported from a csv file created with matlab. I've seen several memory issues with problems similar to this, what would be the best approach?


title: I can't use some binary operators

text: I'm using the amsmath package, and i want to put in a sentence, the not similar binary operator. I tried this:               ... bla bla $ a \nsim b $ bla bla ...      I get the error: "Undefined control sequence". By the way, if i put **\sim** it works, but i want negate it.


title: Use of \relax after \ifnum ... \fi construction

text: I'm reading Malcolm Clark's _A Plain TeX Primer_. On page 111 there's an exercise to define a macro that prints the current time. I've reproduced Clark's answer below:               \newcount\minleft     \newcount\timehour     \def\thetime{\timehour=\time       \divide\timehour by60 %gives 24 hour part of clock       \minleft=\timehour       \multiply\minleft by-60 %       \advance\minleft by\time    %minutes after hour       \ifnum\time>720\advance\timehour by-12\fi\relax       \number\timehour:\ifnum\minleft<10 %                        0\fi\relax\number\minleft       \ifnum\time>720~p.m.\else~a.m.\fi}      My problem is that I don't know what `\relax` is doing in lines 8 and 10 (after each `\fi`). When I use this macro, it prints the time as it's supposed to: **8:51 p.m.** If I delete the `\relax` in line 8, I get the time but with the hour missing: **:51 p.m.** If I delete the `\relax` in line 10 (and restore the `\relax` in line 8), the macro works again like it did the first time: **8:51 p.m.** I naively thought that the `\fi` that ends the `\ifnum` block ends the processing of whatever's going on in the `\ifnum ... \fi`, and that it wouldn't matter whether `\relax` is there or not, in either place. Clearly that's not the case, but I can't figure out what's happening in line 8, and also why the `\relax` _doesn't_ seem to be necessary in line 10. In a different context the author does explain that `\relax` is a "do nothing" command that (in this other context) prevents TeX from treating the expression before the `\relax` and after the `\relax` parts of the same expression. I get that. But concerning `\relax` after an `\fi`, he says: "The `\relax` is probably not required, but it's always nice to have one in: perhaps an example of 'safe TeX'." This might be good advice, but it is not enlightening. I found the following questions about `\relax` on tex.se, but I don't think they answer my question (or at least I'm not smart enough to figure it out): What is the difference between \relax and {}? What does \relax do? Difference between \relax and % for ending a line Normal \relax vs. frozen \relax So, what is `\relax` actually doing in this macro?


title: Use datatool to read a row from a CSV file, then use the variables in the document?

text: I'm confused about how to use "datatool" to read variables from a row in my database, and pass them on to be formatted in my text. I don't want to make a table, but that's about all there seems to be examples of on the Internet. I have a CSV file made up something like this:               name|points     John|172     Sue|120     Mike|64      After two days of staring at the datatool manual, this is the extent of my success:               \documentclass{memoir}     \usepackage{datatool}     \DTLsetseparator{|}     \begin{document}     \DTLloaddb{players}{database.csv}     \DTLforeach*{players}{\name=name,\points=points}     \subsection{\name}     \textit{\points}     \end{document}      That prints the chosen variables with the formatting I desire, but it only does so with the last entry in the database. My guess is that "\dtlgetrowforvalue{players}{1}{John}" could be used to find John's row in the database, but I don't understand how to integrate that with the commands that read and display the variables. I am unfamiliar with much of the terminology used in the manual, and finding no examples that look like what I wish to achieve, my attempts at bullying my way through by trial and error have failed. I don't necessarily need a working example, but I would very much like for someone here to put me onto the appropriate commands, at least.


title: Content being pushed off page, no new page being started

text: I've got a custom class made for homework assignments, and I'm only just now running into an issue with it. I made a couple of custom environments for problem/solution pairs, and I used a tabular to format the outside environment. I don't know if it's just the interaction with tikz, but my content is pushing text off the bottom edge of the page, and no new page is being started to hold the extra content. The following example is a tad on the long side, but it's the only way I can easily demonstrate what's going on.               \documentclass{article}     \usepackage{circuitikz}     \usepackage{array}     \usepackage{amsthm}     \usepackage{thmtools}     \usepackage{enumitem}          \newcounter{problem}     \setcounter{problem}{0}          \newlength{\mylen}     \settowidth{\mylen}{100}          \newenvironment{problem}[1][]{%       \refstepcounter{problem}       \par\noindent       \begin{tabular}{m{\mylen}p{\dimexpr\linewidth-\mylen-3\tabcolsep\relax}@{}}       \arabic{problem}. & \ifx\relax#1\relax \else\textbf{#1}\\[1mm]&\fi       }       {\end{tabular}\ignorespacesafterend\medskip}%          \newenvironment{parts}       {\begin{enumerate}[label=\alph*)]}       {\end{enumerate}}          \declaretheoremstyle[         within=section,         spaceabove=5mm,         spacebelow=3mm,         headfont=\bfseries,         notefont=\normalfont,         bodyfont=\itshape,         headpunct=\newline,         %postheadspace={10pt},         notebraces={}{},         headformat=\NAME:     ]{proof}          \declaretheorem[style=proof,qed=\qedsymbol,name=Solution]{solution}          \begin{document}       \begin{problem}[Creating Digital Circuits: The Half Adder]         We know that the NAND gate is universal, so all other gates can be built using just NAND gates. Hence we should be able to build a half-adder using NAND gates. And we can.       \begin{parts}         \item Implement the AND operation as a circuit using only 2 NAND gates. [5 marks]=         \begin{solution}\leavevmode           \begin{center}             \begin{circuitikz} \draw             (0,2) node[nand port] (nand1) {}             (2,2) node[nand port] (nand2) {}             (nand1.in 1) node [anchor=east] {x}             (nand1.in 2) node [anchor=east] {y}             (nand1.out) -- (nand2.in 1)             (nand1.out) -- (nand2.in 2)             (nand2.out) node [anchor=west] {$\overline{\overline{x\cdot y}\cdot \overline{x\cdot y}}$};             \end{circuitikz}           \end{center}         \end{solution}         \item Check your design in (a) by showing the full truth table for it. [5 marks]         \begin{solution}\leavevmode           \begin{center}             \begin{tabular}{cccccc}               $x$ & $y$ & $x\cdot y$ & $\overline{x\cdot y}$ & $\overline{x\cdot y}\cdot \overline{x\cdot y}$ & $\overline{\overline{x\cdot y}\cdot \overline{x\cdot y}}$ \\                0 & 0 & 0 & 1 & 1 & 0 \\                0 & 1 & 0 & 1 & 1 & 0 \\                1 & 0 & 0 & 1 & 1 & 0 \\                1 & 1 & 1 & 0 & 0 & 1 \\              \end{tabular}            \end{center}         \end{solution}         \item Implement the OR operation as a circuit using only 3 NAND gates. [5 marks]         \begin{solution}\leavevmode           \begin{center}             \begin{circuitikz} \draw             (0,0) node[nand port] (nand1) {}             (0,2) node[nand port] (nand2) {}             (2,1) node[nand port] (nand3) {}             (nand1.in 1) node [anchor=east] {y}             (nand1.in 2) node [anchor=east] {y}             (nand2.in 1) node [anchor=east] {x}             (nand2.in 2) node [anchor=east] {x}             (nand1.out) -- (nand3.in 2)             (nand2.out) -- (nand3.in 1)             (nand3.out) node [anchor=west] {$\overline{\overline{x\cdot x}\cdot \overline{y\cdot y}}$};             \end{circuitikz}           \end{center}         \end{solution}         \item Check your design in (c) by showing the full truth table for it. [5 marks]         \begin{solution}\leavevmode           \begin{center}             \begin{tabular}{ccccccccc}               $x$ & $y$ & $x\cdot y$ & $\overline{x\cdot y}$ & $\overline{x\cdot y}\cdot \overline{x\cdot y}$ & $\overline{\overline{x\cdot y}\cdot \overline{x\cdot y}}$ \\                0 & 0 & 0 & 1 & 1 & 0 \\                0 & 1 & 0 & 1 & 1 & 0 \\                1 & 0 & 0 & 1 & 1 & 0 \\                1 & 1 & 1 & 0 & 0 & 1 \\              \end{tabular}            \end{center}         \end{solution}              \item By observing that $x\oplus y=(x+y)\cdot(\overline{x\cdot y})$, implement the XOR operation as a circuit using at most 6 NAND gates. [5 marks]         \begin{solution}              \end{solution}         \item Check your design in (e) by showing the full truth table for it. [5 marks]         \begin{solution}              \end{solution}       \end{parts}       \end{problem}     \end{document}


title: fancyhdr style problem

text: I am having some problems with the `fancyhdr` package. How can I achieve the following in my big thesis file: The header should consists of the chapter name at the left side and the page number at the right side. The page with number 1 should be the first page of the first chapter. The "fancy" style should start after the table of contents and everything before should be enumerated with the letter i, ii and so on.


title: problem with substack command

text: Help me please with the following problem. I want to write the following equation               $$\phi(U)_{\substack{\cap\\ \mathbb{R}}}$$       and my problem is `\cap` and `\mathbb{R}` don't appear under `\phi`. How can I do?


title: Keeping TeX Live 2013 updated on Windows

text: I downloaded TeX Live 2013 using the torrent for the *.iso image, because I figured it would be faster than the net-install. However, I am now having issues updating TeX Live 2013. Here's what happens:   1. I run TeX Live Manager (GUI)   2. I press the "Update all installed" button   3. I then get the following message: ![enter image description here](http://i.stack.imgur.com/dUNFr.png)   4. I press "Ok", and then some stuff happens (usually before I can press "Update all installed" again, and I get the following message:![enter image description here](http://i.stack.imgur.com/gDmHG.png)   5. I press "Ok" again, and Tex Live Manager closes   6. Go back to 1, repeat forever Why am I stuck in this loop?


title: Which package is this document using for frames and boxes?

text: The following document (pdf) uses ConTeXt. The source file is too complicated for me to understand and I don't really know ConTeXt. Does anyone know what equivalent LaTeX packages generate similar frameboxes?


title: Looking for symbol: Shield

text: I am looking for a "Shield" symbol: ![enter image description here](http://i.stack.imgur.com/EJiU7.gif) I already perused the Comprehensive Latex Symbol List, with the closest fit being `\dsheraldical` from the dictsym package, which is however non- satisfactory because of the diagonal bar - I need both the symbol itself and a strike-through version of the symbol, and that doesn't look good with `\dsheraldical`. I also tried Detexify, but either my drawing skills suck or such a symbol simply doesn't exist. Any suggestions - either for where to find that symbol, or how to "create" it through other ways? **EDIT:** Building on Jake's answer, my solution looks like this:               \usepackage{tikz}          % Smaller than Jake's version, which was much larger than other symbols     \newcommand\shield{ \tikz [baseline] \draw (0,1.5ex) -- (0,0.75ex) arc [radius=0.5ex, start angle=-180, end angle=0] -- (1ex,1.5ex) -- cycle; }     % Strikethrough version of the same symbol     \newcommand\struckshield{ \tikz [baseline] \draw (0,1.5ex) -- (0,0.75ex) arc [radius=0.5ex, start angle=-180, end angle=0] -- (1ex,1.5ex) -- cycle (0,0) -- (1.0ex,1.75ex); }      Look, Ma, I can do TikZ! :-)


title: Slight indentation of customised BibLaTeX bibliography entries

text: I've customised the formatting of some bibliography entry types using `biblatex`. For reasons unknown, the first line of each customised entry type within the bibliography is slightly indented relative to the adjacent un- customised entry types. An example of this is shown below: ![enter image description here](http://i.stack.imgur.com/tdeaw.png) Here is an MWE which recreates the above output:               \documentclass[12pt,a4paper,oneside]{report}          \usepackage{filecontents}     \usepackage[     hyperref=true,     firstinits=true, % render first and middle names as initials     maxcitenames=3,     maxbibnames=99,     style=authoryear,     dashed=false, % re-print recurring author names in bibliography     natbib=true,     useprefix=true, % for inclusion of 'de' 'da' in surname     url=false,     urldate=long,     backend=biber     ]{biblatex}                    % No unit separator after publication year:     \usepackage{xpatch}\xapptobibmacro{date+extrayear}{\nopunct}{}{}          % No month for publication year:     \AtEveryBibitem{\clearfield{month}}          % Use single quotes around titles:     \usepackage[british]{babel}     \usepackage{csquotes}          \DeclareNameAlias{author}{last-first}     %\renewcommand*{\mkbibnamefirst}[1]{{\let~\,#1}} % insert thin spaces between author initials     %\renewcommand*{\bibnamedelimd}{\addlpthinspace} % insert thin spaces between author initials     \renewcommand*{\bibinitdelim}{} % no spaces between author initials (requires biber)     \renewcommand*{\nameyeardelim}{\addcomma\addspace} % insert a comma between author and year in-text citations     \renewcommand*{\newunitpunct}{\addcomma\addspace} % comma as separator in bibliography, not full stop     \renewbibmacro{in:}{} % remove 'in:' preceding article title          % Place volume number within parentheses:     \renewbibmacro*{volume+number+eid}{         \printfield{volume}         \setunit*{\addnbspace}% NEW (optional); there's also \addnbthinspace         \printfield{number}         \setunit{\addcomma\space}         \printfield{eid}}     \DeclareFieldFormat[article]{number}{\mkbibparens{#1}}          % Spacing in bibliography:     \setlength{\bibitemsep}{12pt}     \setlength{\bibhang}{16pt}% the hanging indent          \DeclareFieldFormat{year}{\mkbibparens{#1}}     \DeclareFieldFormat{type}{\mkbibbrackets{#1}}     \DeclareFieldFormat{url}{Available at: \url{#1}}          % Customised `image' entry:     \DeclareBibliographyDriver{image}{         \printnames{author}         \newblock         \printfield{year}         \newblock         \printfield{title}         \newblock         \printfield{type}         \addperiod\newunit\newblock         \printlist{publisher}         \newblock         \printfield{url}         \newblock         \printfield{addendum}     \finentry}                    \begin{filecontents}{\jobname.bib}          @Article{Example_Article_1,       Title                    = {Title 1},       Author                   = {Smith, A. B. and Jones, D. C.},       Year                     = {2012},       Month                    = {Oct},       Number                   = {1},       Pages                    = {42},       Volume                   = {10},       Journal                  = {Example Journal},     }          @Article{Example_Article_2,       Title                    = {Title 2},       Author                   = {Smith, A. B. and Jones, D. C.},       Year                     = {2012},       Month                    = {Oct},       Number                   = {1},       Pages                    = {42},       Volume                   = {10},       Journal                  = {Example Journal},     }          @Image{Example_Image_1,       Title                    = {Title 1},       Url                      = {example.com},       Addendum                 = {(Accessed: 1 January 2013)},       Type                     = {Photograph},       Author                   = {Doe, J. D.},       Year                     = {2009},     }          @Image{Example_Image_2,       Title                    = {Title 2},       Url                      = {example.com},       Addendum                 = {(Accessed: 2 January 2013)},       Type                     = {Photograph},       Author                   = {Doe, J. D.},       Year                     = {2009},     }          \end{filecontents}               \addbibresource{\jobname.bib}               \begin{document}          \printbibliography[title=References]          \end{document}      Do I need to explicitly define a biliography environment using `\defbibenvironment{bibliography}` and then adjust `\setlength`, `\itemindent`, and `\leftmargin` to rectify these indentations? Thanking you in advance, Baldwin


title: Books, Parts, and Prologues

text: I'm trying to nicely format a fairly large novel, with the following structure:               Preamble     Prologue     Book I         Part I             Chapter 1                 ...     (etc.)     Epilogue     Postamble      I'm using memoir and everything looks quite nice, but for the fact that I don't know how to print a pretty page for "Prologue", "Epilogue", or any of the headers for the Books. Memoir is pretty smart about the Chapters and Parts, is there any higher level of structure for things like Prologues/Epilogs and or structure at the super-part level? For reference, here is a minimal working example:               \documentclass{memoir}     \begin{document}          \chapterstyle{demo}     \chapter*{Preamble}         Preamble     \chapter*{Prologue}         Prologue          \chapterstyle{default}     \chapter*{Book I}     \newpage         \setcounter{chapter}{0}         \part{Part I}             \chapterstyle{hangnum}             \chapter{Chapter 1}                 Chapter 1     \end{document}      I am in no way attached to this layout and it's trivial for me to change, I just want it to look nice in the end. So far this is a decent solution, but I was wondering if there were a better / more intelligent way to do it. Currently the largest problem with this layout is that I haven't figured out how to have the chaptermark be `Prologue` instead of `CHAPTER 0. PROLOGUE`, in the prologue, but I'm sure it's possible.


title: When the left-right parenthesis is too big, how to make it smaller?

text: When the left-right parenthesis is too big as in the example below, how do you make the parenthesis smaller?                        \documentclass[reqno]{amsart}               \usepackage{amssymb}              \usepackage{mathrsfs}              \usepackage{amsmath}              \usepackage{amsthm}              \usepackage{stackrel}              \usepackage{courier}             \usepackage[all,cmtip]{xy}              \usepackage{mathtools}              \usepackage{hyperref}             \usepackage{multicol}             \usepackage{enumerate}             \usepackage{bookmark}                  \begin{document}                           $ \left(           \bordermatrix{             &   &        \cr              &a_{11} & a_{12} \cr              &a_{21} & a_{22} \cr              },           \bordermatrix{             &   &        \cr              &b_{11} & b_{12} \cr              &b_{21} & b_{22} \cr              }                   \right) $                                  \end{document}      The command \small doesn't seem to work; I am getting errors. I would like the outer parenthesis to be the same size as the parenthesis around the matrices.


title: List Numbering Through Multiple Tables

text: I am seeking to create a math workbook that looks similar to the picture below. I have included a selection of code I am attempting to get working - marked as MWE. My issue is that I want to continue a list that I have already begun - a list named: `ptestlist`. The problem I am having is that I am trying to use `tabularx` to form the Column A and Column B, along with the answer choices. I plan on resuming the list with `resume=ptest` for each subsequent table. It is crucial that the numbering is automatic so that any additions or subtractions from question numbers are recalculated. My original thought was to simply input my `ptestlist` into a `multirow` cell and continue the table as normal, but I get an error. ![enter image description here](http://i.stack.imgur.com/QP6TK.png) MWE: (or at least my attempt)               \documentclass[letterpaper,twoside,openright]{memoir}     \usepackage{enumitem}         \newlist{ptestlist}{enumerate}{2}         \setlist[ptestlist]{label={\arabic*.},itemsep=5mm,labelsep=3mm,topsep=1cm}          \usepackage{multirow}     \usepackage{multicol}     \usepackage{tabularx}         \newcolumntype{Y}{>{\centering\arraybackslash}X}          \begin{document}          \begin{center}     {\LARGE Part Two --- Quantitative Reasoning}     \end{center}          \textbf{Directions:} Choose the best answer from the four choices given.          \hrulefill     %-----------        Questions           --------------%      \begin{multicols}{2}          \begin{tabularx}{\columnwidth}{YXX}          \multirow{2}{c}{     \begin{ptestlist}[series=ptest]          \item ?     \end{ptestlist} }     &     \underline{Column A}     &      \underline{Column B}      \\     &     $ 5 + 2 \times ( 4 + 3 )$     &     $19$     \\     \end{tabularx}     \end{multicols}     \end{document}      [UPDATE] Ok. So I think I have answered my own question, but have run into another. This may require a new question post however - which I have asked here: Anchoring Table (Tabularx) from the Bottom of Table First, the solution I discovered is rather simple. I just didn't think about it this way. See below. My new problem though is aligning the question number with the answer choices under "Column A" and "Column B" (as you can see in the image above). The question number is specifically aligned next to the answer choices, not the shapes in my MWE for example. MWE (Solution):               \documentclass[letterpaper,twoside,openright]{memoir}     \usepackage[bmargin=1in]{geometry}     \setlength{\parindent}{0pt}          \usepackage{enumitem}         \newlist{ptestlist}{enumerate}{2}         \setlist[ptestlist]{label={\arabic*.},itemsep=5mm,labelsep=3mm,topsep=1cm}          \usepackage{multirow}     \usepackage{multicol}     \usepackage{tabularx}         \newcolumntype{Y}{>{\centering\arraybackslash}X}          \usepackage{tikz}          \begin{document}          \begin{center}     {\LARGE Part One --- Word Problems}     \end{center}          \textbf{Directions:} Choose the best answer from the four choices given.          \hrulefill     %-----------        Questions           --------------%      \setlength{\columnsep}{50pt}     \begin{multicols}{2}     \begin{ptestlist}[series=ptest,labelsep=0pt]     \item \begin{tabularx}{3in}{YY}           \underline{Column A}           &           \underline{Column B}           \\           $6 + 4 - 5 \times 6$           &           34           \\           \end{tabularx}          \item \begin{tabularx}{3in}{YY}           \multicolumn{2}{c}           {           \begin{tikzpicture}           \draw (-1.85,0) node [rectangle,draw,minimum size=1in,                                 label=below:$2x$,label=right:$x$] (rsquare) {};           \draw (1.75,0) node [rectangle,draw,minimum size=.8in,                                 label=below:$2y$,label=right:$y$] (lsquare) {};           \end{tikzpicture}           } \\           \underline{Column A}           &           \underline{Column B}           \\           34           &           34           \\           \end{tabularx}          \item \begin{tabularx}{3in}{YY}           \underline{Column A}           &           \underline{Column B}           \\           34           &           34           \\           \end{tabularx}          \item \begin{tabularx}{3in}{YY}           \underline{Column A}           &           \underline{Column B}           \\           34           &           34           \\           \end{tabularx}     \end{ptestlist}          \end{multicols}     \end{document}


title: Collect in mdframed and print at the bottom of the next page

text: I am trying to collect say fruits mentioned in a page and print them at the bottom of the next page. All text is always enclosed in a frame and the frame can span multiple pages but the collected fruits always have to be printed at bottom of the next page after being mentioned in a page. The problem is that if two frames start on a page and the fruits inside second frame appear in the next page they will be printed together with that of first frame but that shouldnt be the case.               \documentclass{article}     \usepackage{blindtext}     \usepackage{atbegshi}     \usepackage{picture}     \usepackage{mdframed}     \usepackage{collect}               \newenvironment{fruit} {\begingroup\edef\x{\endgroup\noexpand\collectfruits}\x}{\endcollect}               %to print to bottom of next page after fruits named on page     \newcommand{\printbottomNext}[1]{     {\LARGE print on bottom of next page\\}       \AtBeginShipoutNext{%       \AtBeginShipoutUpperLeft{%         \put(0.1\paperwidth,-0.95\paperheight){#1}%       }%     }     }          \definecollection{fruits}          \newcommand\collectfruits{%     \collect{fruits}     {}     {}     {}%     }          \begin{document}          \begin{mdframed}[frametitle=with apple and orange]           \blindtext[3]      \begin{fruit}      apple      \end{fruit}           \begin{fruit}      orange      \end{fruit}           \printbottomNext{\includecollection{fruits}}      \blindtext[2]          \end{mdframed}          \begin{mdframed}[frametitle=with pineaple and banana]           \blindtext[3]      \begin{fruit}      pineapple      \end{fruit}           \begin{fruit}       banana     \end{fruit}           \printbottomNext{\includecollection{fruits}}      \blindtext[2]          \end{mdframed}          \end{document}


title: "References" section in a CV

text: By "References", I mean the recommendation letter writers, For example, the VERY bottom of this CV, http://pages.uoregon.edu/bwebster/NSA-CV.pdf with 4 people. Can someone point to a CV template with this "references" section? Or maybe what functions should I use to make such effect? (with 2 people on parallel blocks) I find plenty of CV templates online, but none of them has this part.


title: Is it possible to extract a .cls from a .dtx and avoid the Two \LoadClass commands error?

text: I have tried to adapt Joseph Wright's model dtx file for a class that I'm writing based on the `article` class (a reduced working example is below, which I have named `democlass.dtx`). But when I run `pdflatex democlass.dtx` I get the error `! LaTeX Error: Two \LoadClass commands.` Clearly, there is only one `\LoadClass` statement, so it must be getting loaded a second time somewhere. So, is it possible to extract a .cls file from a .dtx file when the .cls file is based on the `article` class? I've searched high and low for a solution, and I'm stumped.               % \iffalse meta-comment     % !TEX program  = pdfLaTeX     %<*internal>     \iffalse     %</internal>     %<*readme>     demopkg --- readme text and license (truncated for this example)     %</readme>     %<*internal>     \fi     \def\nameofplainTeX{plain}     \ifx\fmtname\nameofplainTeX\else       \expandafter\begingroup     \fi     %</internal>     %<*install>     \input docstrip.tex     \keepsilent     \askforoverwritefalse     \preamble     demopkg --- readme text and license (truncated for this example)          \endpreamble     \postamble          Copyright, maintenance, and included files (truncated for this example)          \endpostamble     \usedir{tex/latex/demopkg}     \generate{       \file{\jobname.cls}{\from{\jobname.dtx}{class}}     }     %</install>     %<install>\endbatchfile     %<*internal>     \usedir{source/latex/demopkg}     \generate{       \file{\jobname.ins}{\from{\jobname.dtx}{install}}     }     \nopreamble\nopostamble     \usedir{doc/latex/demopkg}     \generate{       \file{README.txt}{\from{\jobname.dtx}{readme}}     }     \ifx\fmtname\nameofplainTeX       \expandafter\endbatchfile     \else       \expandafter\endgroup     \fi     %</internal>     %<*class>     \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{demopkg}[2009/10/06 v1.0 description text]     %</class>     %<*driver>     \documentclass{ltxdoc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage{\jobname}     \usepackage[numbered]{hypdoc}     \EnableCrossrefs     \CodelineIndex     \RecordChanges     \begin{document}       \DocInput{\jobname.dtx}     \end{document}     %</driver>     % \fi     %      %\GetFileInfo{\jobname.cls}     %     %\title{^^A     %  \textsf{demopkg} --- description text\thanks{^^A     %    This file describes version \fileversion, last revised \filedate.^^A     %  }^^A     %}     %\author{^^A     %  You\thanks{E-mail: you@your.domain}^^A     %}     %\date{Released \filedate}     %     %\maketitle     %     %\changes{v1.0}{2009/10/06}{First public release}     %     %\DescribeMacro{\examplemacro}     % Some text about an example macro called \cs{examplemacro}, which     % might have an optional argument \oarg{arg1} and mandatory one     % \marg{arg2}.      %     %\StopEventually{^^A     %  \PrintChanges     %  \PrintIndex     %}     %     %    \begin{macrocode}     %<*class>     %    \end{macrocode}     %         %\begin{macro}{\LoadClass}     %    \begin{macrocode}     \LoadClass{article}     %    \end{macrocode}     %\end{macro}      %     %    \begin{macrocode}     %</class>     %    \end{macrocode}     %\Finale


title: search and replace string in all files

text: I realize that this might not strictly be a LaTeX question but I have still decided to post the question here as other's might have the same problem on occasion. I am working on a rather large document at the moment that contains a bunch of equations. Instead of writing them as:                   Q^{h}_{Con} = 0.15 \cdot Q^{h}_{Transm} + ...      I would rather do this:               \newcommand{\qCon}{Q^{h}_{Con}}     \newcommand{\qTransm}{Q^{h}_{Transm}}     ...     \qCon = 0.15 \cdot \qTransm + ...      Now it is not hard to do this if you have that idea when you start writing on a document. In my case however I already have many pages written (including a nomenclature). Now I would like to replace all mentions of e.g. `$Q^{h}_{Con}$` with `$\qCon$`. Doing this I could make sure that I don't have a typo somewhere and up with a `$Q^{h}_{Com}$`. Going through all files on their own is way too complicated and the tex editor I am using only offers search and replace in all opened files. So I have tried to use the Terminal (on Mac) to do so. I have been able to use 'grep' to find all the instances of e.g. `$Q^{h}_{Con}$` but could not figure out how to replace it with `$\qCon$`. Anyone has an idea?


title: How can I properly align the line numbers of a source code listing with the margin?

text: I want to include a code snippet in a document using the listings package. In my document, I have the following:               \begin{figure}[!htbp]     \setlength{\fboxsep}{0pt}%     \setlength{\fboxrule}{0pt}%     \begin{center}       \lstset{language=Java, numbers=left, showspaces=false,         showstringspaces=false, tabsize=2, breaklines=true}          \begin{lstlisting}     public class AutoRegistry {       public void registerCar(int ssn, int vin) {         // ...         PersonCarDirect personCar = new PersonCarDirect();         personCar.setId(ssn);         personCar.setVin(vin);         // ...       }     }     \end{lstlisting}     \end{center}     \vspace{-12pt}     \caption{AutoRegistry client class}     \label{fig:autoRegistryClientC}     \end{figure}       When I generate my PDF document using pdflatex, the line numbers are too far to the left - I don't want them to be in the margin. (See image below.) How can I correct this? ![enter image description here](http://i.stack.imgur.com/dZwAo.png)


title: Hyperlinked nodes in TikZ mindmap

text: I am trying to make a small mindmap such that some of the child nodes are hyperlinked. I tried to follow the advice given here, about the new node style `hyperlink node`, but the following MWE compiles with errors. Just to clarify the structure of the MWE, it first defines the `hyperlink node` style, which is then subsequently used in the line                 node[concept, hyperlink node=www.google.com] {practical}      Here is the MWE (which is adapted from here):               \documentclass{article}     \usepackage[hidelinks]{hyperref}          \usepackage{tikz}     \usetikzlibrary{mindmap,trees}          \begin{document}     \pagestyle{empty}     \tikzset{         hyperlink node/.style={             alias=sourcenode,             append after command={                 let     \p1 = (sourcenode.north west),                     \p2=(sourcenode.south east),                     \n1={\x2-\x1},                     \n2={\y1-\y2} in                 node [inner sep=0pt, outer sep=0pt,anchor=north west,at=(\p1)] {\hyperlink{#1}{\phantom{\rule{\n1}{\n2}}}}             }         }     }     \begin{tikzpicture}       \path[mindmap,concept color=black,text=white]         node[concept] {Computer Science}         [clockwise from=0]         child[concept color=green!50!black] {           node[concept, hyperlink node=www.google.com] {practical}           [clockwise from=90]           child { node[concept] {algorithms} }           child { node[concept] {data structures} }           child { node[concept] {pro\-gramming languages} }           child { node[concept] {software engineer\-ing} }         }           child[concept color=blue] {           node[concept] {applied}           [clockwise from=-30]           child { node[concept] {databases} }           child { node[concept] {WWW} }         }         child[concept color=red] { node[concept] {technical} }         child[concept color=orange] { node[concept] {theoretical} };     \end{tikzpicture}\end{document}      Any advice on how to make mindmaps in TikZ hyperlinkable or help fixing this solution would be appreciated.


title: How to have a figure touch the edge of the page?

text: How can I position a figure (picture) so that it:   * is aligned on the left-hand side with the text (this is in two column page)   * touches (or exceeds) the right-hand side of the page? An example can be found here: http://library.fes.de/pdf- files/akademie/berlin/04801.pdf (go to any page with a picture and see how the picture is placed.) Note: The example is not what I would call pretty; I think the design is hideous. None the less, I'd like to know how to accomplish this style design for pictures.


title: Modify Biblatex so citations appear as (author, year: pagenos)

text: I am really struggling to find a way to modify biblatex authoryear so that it comes out in this modified Harvard style. In case any solution can be helpful to others in the future, this is the style Sage Journals request. What I want: (author, year: page).Biblatex author year normally produces something like this: (author year, page). By page, I mean the page in the cited document with the referenced material. Here is a sample bibtex reference and how I would like it to apprear:                   @book{Varshney:2003tn,         author = {Varshney, Ashutosh},         title = {{Ethnic Conflict and Civic Life}},         publisher = {Yale University Press},         year = {2003},         series = {Hindus and Muslims in India},         isbn = {9780300100136},         language = {English},         date-modified = {2012-12-14T03:45:28GMT}}      In-text citation:                   Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua (Varshney, 2003: 83-85).      Bibliography Entry:                   Varshney, Ashutosh. (2003) *Ethnic Conflict and Civic Life: Hindus and Muslims in India*. Yale University Press.      Any help is much appreciated! EDIT: Included an example!


title: Audio examples in phonetics project

text: I am writing a project about phonetics and would ask if there is a way to include sound files directly in the PDF to be played directly in this file, preferably without any additional files having to be distributed along with the PDF. I already know that it is possible to include media files in a PDF, but I would like it to be implemented as a short ![loudspeaker](http://ordnet.dk/ddo/speaker.gif)-like button next to the word which, when clicked, plays the corresponding audio file (it needs to be this small, since I'm going to use MANY sound files in the same PDF). I don't want any player or anything else to appear; the sound should just play quickly and smoothly, end of story, and clicking it again should give the same result. In fact, I would like it to function a bit like the sound file function on this website. I do realize, of course, that maybe all of this is not even technically possible.


title: MetaPost to PDF in Texmaker (miktex)

text: I am trying to make the MPost command in Texmaker work. I am using the Texmaker in windows 7 with miktex. So far I used the example document below. When using the windows console I was able to use following command for convertnig the .mp file to a pdf (a frient told me to rename the pdf because the previewer of texmaker only reads pdfs with the same name as the input file):               mptopdf testfile.m && ren testfile-mps.pdf testfile.pdf      This command works great in the console, but when I tried to use it in Texmaker it didn't work anymore:               mptopdf %.mp && ren %-mps.pdf %.pdf       When using just               mptopdf %.mp      The pdf testfile-mps.pdf is being generated but when pressing "view PDF" texmaker says 'file not found'. To my questions:   * So how can I make the rename command work properly?   * Or can I make texmaker showing the *-mps.pdf file?   * What is the command for automatically showing a pdf in texmaker? (So you only have to press one button for compiling and previewing) Here my testdocument _testfile.mp_               outputtemplate:="%j.mps";     beginfig(1);     z1=(0,0);     z2=(10mm,10mm);     drawarrow(z1--z2);     label.ulft(btex $A$ etex, .5[z1,z2]);     endfig;     bye


title: Indent subsections in Beamer's TOC

text: Following Beamer: increase radius of circle in TOC and include subsection bullet I set the 'subsection in toc' of Beamer by:               \setbeamertemplate{subsection in toc}      {\leavevmode\leftskip=2em$\bullet$\hskip1em\inserttocsubsection\par}      However, if a subsection title exceeds the current line, the new line is not indented correcty; the new line begins below the bullet and is not aligend with the first line. How can I change this? ![enter image description here](http://i.stack.imgur.com/ltm7y.png)


title: pgfplots line colors

text: Is it possible to make `pgfplots` use a predefined color map while plotting multiple lines, I currently have 9 samples that I want to plot, but don't want to type different colors for each one. Right now they are all showing up as black. Let me know if this is possible, thanks!


title: How to avoid section title at the top of the page overlap the section title in the page itself (screenshot attached)

text: I am having a problem where a longer `\section` title overlaps itself. I am using the `memoir` class and it's printed both at the beginning of the page and in the page itself (see screenshot), and in my case they overlap. Anyone knows how to fix this? ![enter image description here](http://i.stack.imgur.com/6BGmZ.png)


title: Where do I find the pgf manual v2.00?

text: This might be a very stupid question, but I don't manage to find the pgf manual `v2.00`. On CTAN I only found `v2.10`. (I'd like to find it because I want to follow Andrew's comment to this great answer.)


title: How can I prevent lstlisting with shadowbox-style to be split?

text: I have my listings styled with `frame=shadowbox`. In some cases the lower or upper border of a listing appears on the previous or next page (see screenshot). I do not wrap the listing in a `minipage` because I do not want to prevent general splitting of listings. **How do I prevent the border of a listing being put on the next or previous page?** ![shadowbox border appears on next page](http://i.stack.imgur.com/AxboY.png)


title: Creating a central bibliography

text: I am trying to create a central bibliography (`.bib` file) in a directory outside of my LaTeX project. I want to do this so I don't have to have different `.bib`'s for each paper I write. Currently in each `.tex` file I write:               \bibliography{central-bibliography}      at the end where I want to put it. My `.bib` file is called `central- bibliography.bib`. The `.bib` file is in the same directory as the `.tex` file. If I put the `.bib` file in an arbitrarily located directory, how would I reference it in the `.tex` file?


title: detecting before/after pages in \backrefentrycount

text: I'm using memoir, (optionally) hyperref, and backref. In the back references of my bibliography, I want all the references that come before the Endnotes "chapter" to be formatted differently. The hooks seem to be there. I can insert a label or anything else to identify where the Endnotes "chapter" begins. After some study and experimenting, I've proven only that I don't know LaTeX well enough to attempt this. Conceptually, I think I want something like this:               \renewcommand*{\backrefentrycount}[2]{%     \ifnum \getrefnumber{#1}>\getrefnumber{chap:Endnotes} %     #1%     \else %     \textbf{#1}%     \fi%     }%     %      But of course, something that actually works, instead of this. I (think) I really just want to end up comparing two raw page offsets without regard for any other kind of numbering issues (like preface roman numeral page numbers), but I can't figure out if there's any such mechanism available or if the job is more difficult than I imagine.


title: Transparent background for mdframed environment?

text: Is it possible to specify a transparent background colour for the mdframed environment, so that anything which might be underneath will be visible?


title: Table doesn't fit with title in just one page

text: I want a chapter tittle and a table to fit in just one page. It looks possible as it is enough space, but this is the output: ![enter image description here](http://i.stack.imgur.com/Dsnpo.png) The code used is:               \afterpage{     \chapter{Esquemáticos y PCB}     \clearpage     % flush out other floats waiting to be typeset     \begin{table}     \centering     \begin{tabular}{@{}cp{10cm}@{}}     \toprule     Nº referencia & Descripción \\     \cmidrule(l){1-1}\cmidrule(l){2-2}     3113067-01 & Esquemático del primer prototipo de placa (página 1)\\     3113067-02 & Esquemático del primer prototipo de placa (página 2)\\     3113067-03 & Esquemático del primer prototipo de placa (página 3)\\     3113067-04 & Cara TOP de la PCB del primer prototipo de placa\\     3113067-05 & Cara BOTTOM de la PCB del primer prototipo de placa\\     3113067-06 & Vías de la PCB del primer prototipo de placa\\          3113067-07 & Esquemático del diseño final de placa (página 1)\\     3113067-08 & Esquemático del diseño final de placa (página 2)\\     3113067-09 & Esquemático del diseño final de placa (página 3)\\     3113067-10 & Cara TOP de la PCB del diseño final de placa\\     3113067-11 & Cara BOTTOM de la PCB del diseño final de placa\\     3113067-12 & Vías de la PCB del diseño final de placa\\          3113067-13 & Esquemático de la placa de la tarjeta SD \\     3113067-14 & Cara TOP de la PCB de la placa de la tarjeta SD\\     3113067-15 & Cara BOTTOM de la PCB de la placa de la tarjeta SD\\     3113067-16 & Vías de la PCB de la placa de la tarjeta SD\\     \bottomrule     \end{tabular}     \caption{Referencia y descripción de los planos del Apéndice A}     \label{planostable}     \end{table}           \clearpage}  % prevent other material from being placed on this page      NOTE: I posted before for this same problem for figures and I tried aswking this there too once the image problem was solved, but I got the question closed, so I open a new one as I understand this is a different question.


title: Good practice on spacing

text: In various places, in passing, I've seen mention of various good practices regarding well-behaved spacing in LaTeX. For example, `Dr. Who` should really be written `Dr.\ Who` or `Dr.~Who` to get the right spacing (Since the full stop is not the end of a sentence. Similarly with integrals: `\int x\, dx` should be preferred to `\int x dx` to properly space out the "`dx`". But this is all piecemeal advice for specific circumstances: what are the general principles guiding when to pay attention to how LaTeX is dealing with your spaces?


title: How to properly write long logical formulas?

text: I need to write many mathematical statements written as first order logical formulas. Usually I can't have them on a single line because they tend to be too long. The following one is an example of what I managed to accomplish:               \begin{gather}\begin{split}      & \forall G\left(\phi_1\leftrightarrow\phi_2\right) \\      & \qquad G\text{ is a group} \\      & \qquad \exists G_0\exists\mathord{*}\exists e\left(\bigwedge_{i=3}^7\phi_i\right) \\      & \qquad\qquad G=\left(G_0,\mathord{*}\right) \\      & \qquad\qquad \mathord{*}:G_0\times G_0\rightarrow G_0 \\      & \qquad\qquad \mathord{*}\text{ is associative} \\      & \qquad\qquad e\text{ is the identity of }\mathord{*} \\      & \qquad\qquad \forall g\left(\phi_8\rightarrow\phi_9\right) \\      & \qquad\qquad\qquad g\in G_0 \\      & \qquad\qquad\qquad \exists g'\left(\phi_{10}\land\phi_{11}\right) \\      & \qquad\qquad\qquad\qquad g'\in G_0 \\      & \qquad\qquad\qquad\qquad g'\text{ is the inverse of }g\text{ with respect to }\mathord{*} \\     \end{split}\end{gather}      I'm not very happy with the result, mainly because of the qquads and the ampersands. I cannot use the itemize environment because five levels of nesting is too much for LaTeX. Also, the itemize environment would force me to add the displaystyle command in front of every formula. So, it there a better way to achieve this? Thanks. Addition The above formula renders as ![alt text](http://i.stack.imgur.com/YgPq0.png)


title: Error-handling in next-generation TeX tools

text: For many beginners (and many with more experience), the biggest obstacle to using LaTeX is the difficulty of figuring out what is causing an error. A message about something not being `\def`ed, for instance, will make no sense to a novice LaTeX user who might possibly have heard of `\newcommand`, but certainly not `\def`. Additionally, line numbers can be misleading, and error message sometimes print out macros given by internal definitions that bear no resemblance to the user's code that actually created the problem. Is there any hope that next-generation TeX tools like LaTeX3, LuaTeX, and ConTeXt will provide (and/or force package authors to use) a better mechanism for handling errors? For instance, would it be remotely feasible to include something remotely resembling "print stack trace"?


title: 'alpha' inside a \def

text: the following code               \def\AIR{\alphair}      results in a compilation error in Texmaker when calling \AIR\ in text:               "\textit{\AIR\/}"     ! Undefined control sequence.\AIR ->\alphair      Where's the problem with MikTex?


title: pdflatex.exe on both dualcore-cores?

text: Is it possible to load pdflatex on both dualcore-cores of my Intel Core2Duo- Processor? At the moment, pdflatex just uses one core while the second core stays idle. I got a pretty big document of 200 pages with many non-eps-pictures included... Thanks a lot in advance!


title: Place a figure at the top of the next page

text: I wanted to place a figure at the top of the next page.               \blindtext \blindtext \blindtext     \begin{figure}[htbf]         \centering             \includegraphics[width=0.9\textwidth]{C:/Thesis/Latex/thesis_1(1)/Figures/studyArea.jpg}             \rule{35em}{0.3pt}         \caption{The Grand St. Bernard wireless sensor network deployment (a) the coordinates of nodes according to the Swiss coordinate system (b) the distribution of the nodes in the study site \citep{r33}}         \label{fig:study area}     \end{figure}     \FloatBarrier     \blindtext


title: The index of head row doesn't begin with 1

text: This seems a very simple question, but I cannot find an answer. * * * I have a very simple CSV file and I want to make a LaTeX table from it. tiny.csv               -1, 1, -1, 1     2, 4, 6, 8     3, 9, 27, 81      LaTeX file               \documentclass{standalone}     \usepackage{pgfplotstable}          \begin{document}          \pgfplotstabletypeset[col sep=comma]{tiny.csv}          \end{document}      Then I have a table as follows:                0  1   2   3       <- head row     −1  1  −1   1      2  4   6   8      3  9  27  81      I wish the numbers in the head row to begin with 0, not 1. And I don't want to change the file tiny.csv as it will be used by other scripts for experiment. How can I change the head row to '1 2 3 4' from '0 1 2 3'?


title: Is there a simple way to use the gentium font in latex?

text: I'd like to use the gentium font in a LaTeX document, and the instructions I found at this site make it look rather difficult. Is there a simple package that is now available that would allow me to use the gentium font more easily?


title: LyX - changing subsection from numbers to letters

text: I have a problem set that I want to type up. In my section, i get numbers which is fine since I have 4 problems on my problem set. But each subsection is lettered on my problem set, so I would like my solution set to also match it. Right now it turns into 1.1, 1.2 ... Also when I select subsection and try to do a display type formula, it moves my section number in the middle too. If I press enter on it it just removes the subsection. What to do? thanks


title: How to best debug LaTeX?

text: ..and I don't mean finding out why it doesn't compile, I mean serious debugging: breakpoints, figuring out value of variables at a given moment during run/compile, stepping, examining a stack (is there one?), etc. All the things that we take for granted when debugging a "real" programming language. Since TeX is "turing-complete", I would like to be able to really see what is going on internally. I'm guessing that a GUI interface for the debugger would be too much to ask, but if it exists, I'd love to hear about it.


title: Change the font of the block quote?

text: Sorry if this is a duplicate, but I can't find the right way of doing this. I want to redefine my `quote` and `quotation` commands to use a different font. My main font is `Linux Libertine O` (I am using fontspec), and I want to use the _small_ version of `Linux Biolinum O` inside my quotations. Among some of the commands I've tried is this, but it ain't working:               \let\quoteOld\quote     \renewenvironment{quote}{\fontspec{Linux Biolinum O}\small\quoteOld}      Bonus question: What do I need to learn, in order to figure out how to achieve the above by myself? I would appreciate a book or resource to read.


title: Add customized text at an optional page-break

text: This question stems from Add text at an optional page-break only when breaking occurs and David Carlisle's excellent answer. The question there was how to put text between tables when there is an (optional) page-break, e.g.               [ Table 1 ]        Continued on next page     ---- page break ----        Continued from previous page     [ Table 2 ]      David's answer was to use a longtable. The question I have here is if one has three or more tables, how can one insert custom text between each table when there is a page break between them. For example:               [ Table 1 ]        The result of Table 1, XYZ, is carried over to the next page.     ---- page break ----        The result of Table 1 being: XYZ (for more details see the previous page)     [ Table 2 ]        The conclusion of Table 2, XYZ, is used on the next page.     ---- page break ----        The conclusion of Table 2, being: XYZ, is calculated on the previous page.     [ Table 3 ]      The problem with the `longtable` is that the optional text must be identical between tables (i.e. one cannot customize it as between tables). Multiple `longtable` environments would overlap (i.e. a `longtable` for Table 1 + 2, and Table 2 + 3). Is there a solution where one can have 'custom' optional text between tables that break across a page? I would expect that a solution for tables could be extended to parboxes. Thanks for reading.


title: What does 'Label multiply defined' mean?

text: I'm trying to compile this book https://forja.rediris.es/projects/guia- wxmaxima/ I'm using MiKTeX, TeXstudio, and in the build options I have the default compiler pdfLaTeX. So my question is, why there are a lot of errors that say `Label '...' multiply defined`?


title: error with bold font in section title with beamer

text: I am getting errors when compiling a LaTeX document with the `beamer` (v3.13) class when using bold shape in a title section:               \documentclass{beamer}          \begin{document}          \section{The \textbf{Section} Title}          \begin{frame}{Testing frame}       This is a test.     \end{frame}          \end{document}      Compilation with pdflatex gives the error:               ! Argument of \@gobble has an extra }.     <inserted text>                      \par      l.5     \section{The \textbf{Section} Title}      The error happens when using other font variations like slanted and italic. Also the command `\emph` used in a section title gives an error:               ! Undefined control sequence.     \beamer@sort #1#2->\long \def \beamer@todo                                                 {#1}\def \beamer@ospec {}\beamer@...     l.5     \section{The \emph{Section} Title}      Are these known bugs or am I missing something? Is there any fix for them?


title: How to send output of htlatex to different folder without fixing all image links afterwords

text: The setup is simple. I have a file report.tex which includes an image from a folder. I send the output of htlatex to a separate directory. htlatex copies all images and HTML to that directory. The problem though, now all the links in the HTML are broken, since the links are generated relative to original location of report.tex and not to where the HTML now lives. In pictures, I have this                report.tex ...\includegraphics{e1/image.png}        |        +--------------------------+        |                          |        /e1/image.png             /report/                                    report.htm ....<img src="e1/image.png"                                    image.png      One can see the problem. The HTML is using `src=` thinking it was in the original location of the .tex file. So, I end up editing the HTML files fixing links by adding "../" to each image src link or by removing "e1/" since the image was copied! I searched and was not able to find an option to fix this. Does anyone know of a solution to this? Here is minimal working example:               \documentclass{article}%     \usepackage{graphicx}     \begin{document}       \includegraphics{e1/image.png}     \end{document}      Here is the command used                 mkdir report; htlatex report.tex "htm" "" -dreport      and now looking in the folder report/report.htm shows the problem. The image does not show up without manually fixing the links. Doing this works:                 htlatex report.tex "htm"      now the report.htm shows the image ok as expected. But I want all the output to go to separate folder. I am using the TeXlive 2012 Debian package.


title: drawing figure to scale

text: I have a technical drawing of a mechanical setup which I would like to draw in either TikZ or PSTricks. My experience with these two packages is very limited. A "MWE" of the drawing is shown in the following, all units are in meters. I would like to make a drawing which is true to the various scales. I think one way to achieve this is simply to use coordinates to label the various positions and lengths, but I am very interested in reading your comments. ![enter image description here](http://i.stack.imgur.com/vkuoU.jpg) My questions are:   1. Is this even possible?   2. Which package would be best for this purpose? And what strategy can I use to achieve this?


title: Dropped spines in pgfplot

text: How can I achieve something similar to the "dropped spines" example below using **pgfplots**? ![from matplotlib.sourceforge.com](http://i.stack.imgur.com/XDLTk.png)


title: Protecting the argument of a command from the effect of the command

text: How can I "protect" an argument of a command from the effect of the command? The link is interrupted by `\spacedallcaps`               \documentclass{scrreprt}          \usepackage[pdfspacing]{classicthesis}          \begin{document}          \spacedallcaps{\href{http://it.wikipedia.org/wiki/Pagina_principale}{test}}          \end{document}


title: includepdf into .tex file but crop each page's header off

text: I was hoping to find a way to insert several (many) pages of a pdf but crop off the header (with the date, filename, etc.). I'm using               \subsection{Notes}     \includepdf[scale=0.8,pages=8-20,pagecommand=\subsection{blub}]{Notes.pdf}      but maybe I need to use `pdftk` somehow to do the batch cropping? Thanks for any suggestions!


title: Wrap around text inside frame (minipage) in Lyx

text: I want to insert a number of drop-shadowed frame inside a document and place (the same) graphic in the top left hand corner of each box. I would like the text in the rest of the box to wrap around this graphic - with some (arbitrary) margin. What is the best way to do this? I had the graphic in a frame inside the frame but the text all went to the bottom of the frame, apart from the first paragraph. **Update** The general idea is that I want something like this:               -----------frame---------------     |XXXGRAPHICXXXX   mytext here  |     |XXXXXXXXXXXXXX   text again   |     |XXXXXXXXXXXXXX   more text    |     |and the text wraps round the  |     |graphic.                      |     --------------------------------      I haven't added the listing that has been asked for as I am really hoping for a LyX-based solution as opposed to one in LaTeX. But I can add that is people really think it's helpful - it's an article class document, standard LyX template.


title: Starred tabular environment and centered text

text: How to make the starred `tabular` to center text:               \documentclass[varwidth]{standalone}     \begin{document}         \begin{tabular*}{\linewidth}{@{}c@{\extracolsep{\fill}}}             \hline                 Text to be centered \\             \hline         \end{tabular*}     \end{document}      Result: ![enter image description here](http://i.stack.imgur.com/azKHy.png) How is that possible to make the text centered?


title: extracting coordinates from "position" pair in tikz

text: I think I have a simple problem but somehow I'm unable to find any solution: I have the following code:               \begin{tikzpicture}[scale=1 , auto,swap]     \foreach \pos/\name in { {(9,7)}/a, {(6,6)}/b, {(9,5)}/c }{         \node (\name) at \pos {\pos[1]};     }     \end{tikzpicture}      It obviously doesn't work as intended because `\pos[1]` produces labels like `(9,7)[1]`:) Is there a simple way to extract the first coordinate from `\pos`? So that labels of node would be 9,6,9 respectively? And I would like to avoid changing entire loop to something like               \foreach \posX/\posY/\name in { {9/7/a}, {6/6/b}, {9/5/c} }{...}


title: Two cylinders connected with a belt

text: I want to draw two cylinders connected with a common belt around them. Therefore, I need two cycles and two tangents to these two cylinders. I know there is a general solution for my problem How can I draw a tangent ending smoothly in a circle?, but there are two specifics I cannot resolve:   1. I want the belt to have another thickness (i.e. both tangents and outer lines of two cycles)   2. I want to draw a vector of specific length along the belt _between_ two cycles Is there any way to achieve these two goals? ![enter image description here](http://i.stack.imgur.com/4QhTK.png)


title: Correctly highlight long ToC entries using TikZ without pagenumbers

text: Using this answer, I have highlighting for `chapters` in my Table of Contents. For long chapter names, however, the box is wonky, because `P1.north west` and `P1.north east` do not span the entire line:               north west       north east                                      line end     -------------------------------------------------------------------------     This is a longer chapter heading than can fit in an entire line this is a     longer chapter heading than.      This is a problem both with and without the use of page numbers. When `\cftpagenumbersoff{chapter}` **is** used: ![No page numbers](http://i.stack.imgur.com/VHvN8.png) and with page numbers: ![enter image description here](http://i.stack.imgur.com/w16E6.png) My current projects ToC does not use page-numbers. Future projects will, and a solution that works for both would be ideal. ### How can I correctly highlight a long ToC entry using this approach? MWE:               \documentclass{report}     \usepackage{tocloft}     \usepackage{tikz}     \usepackage{xcolor}     % command to make a hidden node     \newcommand*{\hnode}[1]{%         \tikz[remember picture] \node[minimum size=0pt,inner sep=0pt,outer sep=5pt] (#1) {};}     % create a node at the beginning of the chapter entry     \renewcommand{\cftchapfont}{\hnode{P1}\bfseries\Large}     \renewcommand{\cftchappagefont}{\bfseries}     % create a node at the end of the chap page number and draw the gray box     \renewcommand{\cftchapafterpnum}{%       \hnode{P2}\tikz[remember picture,overlay]       \draw (P1.north west)  [line width={25pt}, gray,opacity=.2] -- (\textwidth,0 |- P2);}       %\draw (P1.north west)  [line width={25pt}, gray,opacity=.2] -- (P2.north east);}               \begin{document}     \cftpagenumbersoff{chapter}     \tableofcontents     \addcontentsline{toc}{chapter}{This is a longer chapter title than can fit in a single line}     \end{document}      * * * _My attempt, which hasn't thus far worked_ : Conceptually, if I were to implement a solution, I would first check whether a chapter heading will span multiple lines (count characters, perhaps?). I'd then use a pre-determined `cm` value, with a pre-determined node height, as the bottom-right `TikZ` node coordinate. I thought `\linelength` would work (without page numbers the highlighting is ragged, and in my head my attempt was going to have a neat side-effect of fixing that):               \draw (P1.north west)  [line width={25pt}, gray,opacity=.2] -- (\textwidth,0 |- P2);}      But that resulted in a highlighting extending far past the last word on the line, and the box is not horizontal. The intersection coordinate isn't strictly needed, but I don't know why - I thought I'd have to specify the `y` coordinate. ![enter image description here](http://i.stack.imgur.com/b90ww.png)


title: Getting Gregorio to work on Windows 7

text: I need help trying to get Gregorio working on Windows 7 x64. I've installed TeX Live 2012 and Gregorio, and have configured TeXworks. When I try to compile a tex file, it tells me that it can't find `gregoriotex.sty`, and I also get errors saying it can't find `gregoriotex.cls`.               ! LaTeX Error: File `gregoriotex.sty' not found.      The last few lines of texworx's console output were:               (c:/texlive/texmf-dist/tex/lualatex/luacode/luacode.sty))     (c:/texlive/texmf-dist/tex/latex/geometry/geometry.sty     (c:/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty))      I got this error following the directions here on the Gregorio site I have followed. It seems like there is another setting somewhere in TeX Live, but I can't find it. Here are some commandline directions, whereupon I get the same error. How can I get this to work? * * * _Follow-up question:Texlive and Gregorio Manual Font Installation_


title: pdfsavepos coordinates remains zero

text: My MWE below produces the following in the `\jobname.ypos.txt` file:               {1}{1}{1}{F}{0}     {1}{1}{1}{L}{0}     {1}{1}{2}{F}{0}     {1}{1}{2}{L}{0}     {1}{1}{3}{F}{0}     {1}{1}{3}{L}{0}      Where the bunch of zeros at the end are supposed to be the y-pos coordinates coming from `\pdfsavepos` and `pdflastypos`. I'm obviously missing something fundamental here, but can't figure it out. MWE:               \documentclass[pagesize=pdftex, fontsize=10]{scrbook}     \usepackage[paperwidth=11.2cm, paperheight=17.4cm, top=1cm,bottom=1cm, left=1cm, right=1cm]{geometry}     \usepackage{pdfcolparallel,hanging}     \usepackage{fontspec}          \defaultfontfeatures{Mapping=tex-text}     \setmainfont{Times New Roman}          % Write the position to file.     % #1 is the book number     % #2 is the chapter number     % #3 is the verse number     % #4 is the position, first (F) or last (L), to be saved     \def\msec@write@lines#1#2#3#4{%         \pdfsavepos%         \immediate\write\yposoutputfile{%         \string{#1\string}%         \string{#2\string}%             \string{#3\string}%         \string{#4\string}%             \string{\the\pdflastypos\string}%         }%     }          \begin{document}     \newwrite\yposoutputfile%     \immediate\openout\yposoutputfile=\jobname.ypos.txt%          \LARGE{1} \msec@write@lines{1}{1}{1}{F} LIBRO de la generación de Jesucristo, hijo de David, hijo de Abraham. \msec@write@lines{1}{1}{1}{L}     \msec@write@lines{1}{1}{2}{F} \textbf{2}~Abraham engendró á Isaac: é Isaac engendró á Jacob: y Jacob engendró á Judas y á sus hermanos:\msec@write@lines{1}{1}{2}{L}     \msec@write@lines{1}{1}{3}{F} \textbf{3}~Y Judas engendró de Thamar á Phares y á Zara: y Phares engendró á Esrom: y Esrom engendró á Aram:\msec@write@lines{1}{1}{3}{L}          \immediate\closeout\yposoutputfile%     \end{document}


title: Problem with "and" keyword translation

text: I'm trying to generate bibliography using `bibtex`. My problem is that keyword `and` is not generated to comma. I also want to put First name after Last name. (I'm using Gummi as LaTeX editor). Document:               \documentclass[12pt]{report}          \usepackage[utf8]{inputenc}     \usepackage{polski}     \usepackage[polish]{babel}     \usepackage[T1]{fontenc}     \usepackage{tgtermes}     \usepackage{sectsty}     \usepackage{datetime}     \usepackage[a4paper, left=25mm, right=25mm, top=25mm, bottom=25mm]{geometry}     \usepackage{lipsum}          \selectlanguage{polish}     \title{\textbf{Title}}     \author{Author}     \date{\today}          \begin{document}     \bibliographystyle{plain}     \maketitle          \begin{abstract}          \lipsum[1-3]          \end{abstract}          \tableofcontents          \lipsum     \cite{programowanie}          \bibliography{praca-dyplomowa.bib}          \end{document}      BibTeX:               @Book{programowanie,     author =        "Van Roy, P. and Haridi, S.",     title =         "Programowanie. Koncepcje, techniki i modele",     publisher =     "Wydawnictwo Helion",     year =          "2005",     address =       "Gliwice"     }      ![enter image description here](http://i.stack.imgur.com/lj0XL.png)


title: using \frontmatter kills my {geometry} definitions

text: I use a the jura package to write some home work in Law (to be honest, I'm just helping my girlfriend ...). Anyways, I the header of the document I have:               \documentclass[a4paper]{jura}     \usepackage[T1]{fontenc}     \usepackage{lipsum} % dummy paragraphs.          \usepackage[         top=3cm,          bottom=3cm,          left=7cm,          right=.2cm,          width=500pt,         marginparwidth=0pt]{geometry}          \begin{document}     \lipsum[1-5]     \frontmatter     \lipsum[1-10]     \end{document}      If I include the `\frontmatter` command, the definitions by geometry package are overridden (note that I need to use the `jura` document class). How can I reverse this? Can I have an in-document (e.g. no it preamble) command to change the right margin?


title: Calculating right angle triangle side inside LaTeX

text: I'd like compute the width of a screen from it's diagonal and its aspect ratio inside a LaTeX document. The formula is easy to get from the Pythagorean theorem, but needs square roots. I currently compute this using the `calc` package to compute the square root with the Babylonian method, but it is not very elegant. What is the best way to compute square roots (and other functions) inside latex ?


title: Tikz, how to a simple new shape

text: I want to make a new shape for `switch` in my network diagram. It's really simple based on circle. ![enter image description here](http://i.stack.imgur.com/mBEnt.png) I got this manually by               \def \drawswitch {       \node[circle,draw] (circle){};       \draw (circle.south west) -- (circle.north east);       \draw (circle.north west) -- (circle.south east);     }      but I still want to make it perfect by defining a new shape using `\pgfdeclareshape`, however I've no idea how to overwrite the `\backgroundpath`. I don't know how to find `saved anchor` a circle have and annotations like `\pgf@xb` confused me a lot .