title: Interpolation and curve fitting - Tikzpicture? Gnuplot? Pgfplot?

text: well, I am fairly new to LaTeX, but I tried my hardest do find a solution for my problem but I couldn't find a proper answer, so I hope someone here has the answer or another suggestion for me. I would like to "smooth" my curve, but if I do so the curve will be partially negative, which is physically impossible and therefore no solution for my thesis. I have read that this happens due to the algorithm used. Does someone know how to fix that? Is there any other way to smooth my graph maybe using another package or command? ![enter image description here](http://i.stack.imgur.com/wVLlE.png)               \documentclass{article}     \usepackage[demo]{graphicx}     \usepackage{tabularx}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{booktabs}     \usepackage{float}           \begin{document}               \begin{figure}[H]     \begin{center}         \begin{tikzpicture}         \begin{axis}[         %title=Without legend box,         legend style={draw=none},         grid = major,         %ymin=0,         %ymax=0.000012,         xmax=144,         xmin=100,         %legend columns=2,         width=0.65\textwidth,          height=6.8cm,          legend style={         cells={anchor=east},         legend pos=outer north east,     }]             \pgfplotstableread{Help.txt}             \datatable             \addplot[smooth, no markers, color=black, line width=1.25pt] table[y = P3] from \datatable ;             \addlegendentry{1}  ;             \addplot[smooth, no markers, color=blue, line width=1.25pt] table[y = P4] from \datatable ;             \addlegendentry{2}  ;              \end{axis}     \end{tikzpicture}     \end{center}     \end{figure}          \end{document}      The data               f P3 P4      100 0.000004 0      102 0.000014 0      104 0.000008 0      106 0.000017 0      108 0.000021 0      110 0.000043 0      112 0.000126 0.000005      114 0.000347 0.000023      116 0.0012 0.000113      118 0.00599 0.000735      120 0.061 0.0036      122 0.9 0.144      122.227 1.5 0.273      124 0.13 0.007      126 0.0053 0.0012      128 0.0022 0.00043      130 0.0003 0.0002      132 0.000246 0.000103      134 0.000132 0.000065      136 0.000072 0.00004      138 0.000045 0.000027      140 0.000032 0.00002      142 0.000024 0.000013      144 0.000016 0.000011


title: Applying custom size and spacing to quote environment

text: Am using "article" document class in LyX and trying to get the `quote` paragraph-environment to run with "small" text size and single-spacing (globally), while keeping the rest of the document (standard paragraph environment) with the default settings -- default text size and double- spacing. Have tried using the following in the LaTeX Preamble:               \let\oldquote\quote     \renewcommand\quote{\small\singlespacing\oldquote}      This almost works. The problem is that some paragraphs in the standard environment take on the singlespacing that I am trying to apply (exclusively) to the `quote` environment. How do I make sure that the singlespacing only applies to the `quote` environment?


title: Mathtype Euclid Font in Latex

text: Is there anyway that I can use `Mathtype's Euclid` font in typing _texts_ in LaTeX? Just for the text, not the math mode. Some used to suggest that it's the same as the default `Computer Modern` font in LaTeX, but I strongly disagree with that, and I'm still desperate to use this font in LaTeX. If that's possible, what should I do?


title: How do I prevent proper nouns from being converted to lowercase by a bst file in LaTex?

text: My bibliography contains some items like this: > R. K. Sawyer, “Improvisation and the creative process: Dewey, collingwood, > and the aesthetics of spontaneity,” The problem is that the proper nouns in the title, such as "Collingwood", are getting converted to lowercase when they should not. It should appear like this: > R. K. Sawyer, “Improvisation and the creative process: Dewey, Collingwood, > and the aesthetics of spontaneity,” Another example also removes necessary punctuation: > G. Deleuze, “Lecture transcripts on spinozas concept of affect,” This should be: > G. Deleuze, “Lecture transcripts on Spinoza's concept of affect,” I have checked that they are correct in my bibtex file. I'm using `IEEEtranS.bst`, which is what is introducing these problems (I guess). Advice? It seems like bad design that I should have to further edit my bib file to add braces or something, and it is at least inconvenient given that the bib file is generated with Zotero. I do not want to have to re-edit the bib file every time I re-export the bib file.


title: Search for word and italicize

text: I'm using LaTeX to format my books now. When I transitioned one of my books from Word to LaTeX, the italicized words didn't carry over, so I used the command `\textit{word}`. But after sending it to my editor, I see that one group of words needs to be italicized every time. I need to make the words "South Park" italicized in the entire document. I found one suggestion that I could put in the preamble:               \newcommand*{\southpark}{\textit{South Park}}      But this wasn't quite what I was looking for. I'm looking for a command that can search my document for "South Park" and italicize every instance of it. Is this possible?


title: Remove the page number from CV

text: I'm using the latex template for CV from here CV Template. Now the template includes the page number as page_no/total_page. I tried to few methods to remove this numbering, nothing is working properly - If I do `\pagenumbering{gobble}` it only remove the number not the whole style output as /total_page.               \thispagestyle{empty}      this removes the page number but also revomes the whole footer of the page. In the footer there contains the info


title: Biblatex and citation reset between chapters

text: I have a feeling that there is an obvious answer to this question that I'm somehow managing to miss. However, I've tried most of the commands in the `biblatex` documentation and I still can't figure it out. What I want to do is reset the count for my footnotes and citations between chapters. In addition I also want ibid's, opcit's etc to start again at the beginning of a new chapter. I'm currently using XeLaTeX with `biblatex`. My preamble is:               \documentclass[12pt,oneside]{book}          \usepackage[protrusion=true,expansion=true]{microtype}     \usepackage[style=verbose-trad1=true,natbib=true,sortcites=true]{biblatex}     \bibliography{bib.bib}          %Additional Stuff that I don't think should influenec the bibliography, but is here just in case     \interfootnotelinepenalty=10000     \usepackage{fontspec}     \usepackage{titlesec}     \defaultfontfeatures{Ligatures=TeX}     \usepackage{sectsty}     \allsectionsfont{\sffamily}     \setmainfont{Lyon Text Regular No. 2}     \setsansfont{Lyon Display Light}     \usepackage[margin=3.5cm]{geometry}     \pretolerance=5000     \tolerance=1000      \usepackage{setspace}     \usepackage{graphicx}


title: moderncv, casual style, how to put the contact information in the header

text: I'm using the `moderncv` package with the casual style to write a letter. There the personal data are written at the bottom of the page. Is there a way to put them into the header? Here is a is MWE:               \documentclass[10pt,a4paper,sans]{moderncv}      \moderncvstyle{casual}       \moderncvcolor{blue}     \usepackage[scale=0.75]{geometry}     \usepackage[latin1,ansinew]{inputenc}     \usepackage[ngerman]{babel}                \firstname{Max}     \familyname{Mustermann}     \address{Musterstraße}{Musterstadt}         \mobile{ABCDEF}                           \email{ABCDEF}               \opening{Dear Sir or Madam, }      \closing{Yours Sincerely, }          \recipient{Erika Mustermann}{Musterstadt}          \begin{document}     \selectlanguage{ngerman}     \date{Musterstadt, den \today}     \makelettertitle     Text     \makeletterclosing     \end{document}


title: Vertical alignment of marginnote and section heading

text: Following on from a previous question I asked, I am now having difficulty in vertically aligning my margin note with a section heading. To be clear, the problem is only when I invoke the solution suggested in that question. A minimal working example is as follows:               \documentclass[8pt,a6paper,twoside,parskip=half]{scrartcl}     \RequirePackage{geometry}          % Configure the section style     \RequirePackage{sectsty}     \allsectionsfont{\centering\normalfont\scshape}          \usepackage[fulladjust]{marginnote}          \newcommand{\instruction}[1]{\mbox{}\marginnote{\normalsize\emph{#1}}}          \makeatletter     \renewcommand\marginfont{\normalfont}     \renewcommand\raggedleftmarginnote{\@parboxrestore\@marginparreset\raggedleft}     \renewcommand\raggedrightmarginnote{\@parboxrestore\@marginparreset\raggedright}     \makeatother          \begin{document}     \centering     \section*{A Section Heading\instruction{Do something long here}}     Lorem ipsum dolor sit amet, intellegat definitionem ad eos. Case possim vis     cu, salutandi iudicabit evertitur te mei, aliquip albucius usu et. Mundi     graeco eum in. In elit posse his. Erant primis consulatu est ex, cu sit     ferri reque epicurei, eam an veniam lucilius intellegam.     \end{document}      yielding the following output: ![Vertically misaligned output](http://i.stack.imgur.com/tCAo6.png) in which the margin note is vertically displaced upwards from where it should be. If I undo the changes from the previous question (comment out the bits between `\makeatletter` and `\makeatother`), the vertical alignment is correct, but now the horizontal alignment is wrong (centred, rather than ragged right): ![enter image description here](http://i.stack.imgur.com/QSEPX.png) Now, I can manually insert a `\vskip` into the renewed `\raggedrightmarginnote` and `\raggedleftmarginnote`, but I don't know what value to use for this (that would be robust to e.g. font size changes). Is there some way to get the correct displacement for this? It's also worth pointing out that removing `\normalsize` from the defined `\instruction` command gives the correct vertical position of the text (as might be expected), but I'd like all the margin notes to be the same size.


title: Changing english quotation marks to german + greek text

text: I need to change english quotation marks: “text” into german quotation marks: „text“ through out my entire document. The problem is I used ``text'' and `text' in the entire document. There is another complication. I also have a lot of greek text in the document which is using both ` and ' to produce accents. Is there a way to add something to the preamble to change this throughout the document? Here is my MWE:               \documentclass{scrartcl}     \usepackage[polutonikogreek,ngerman]{babel}%     \usepackage[babel,german=quotes]{csquotes}          \begin{document}     ``Double quotes''          `Single quotes'          \foreignlanguage{polutonikogreek}{`ouko~un t~w m`en >agenn'htw patr`i o>ike~ion >ax'iwma fulakt'eon, mhd'ena to~u e@inai a>ut~w t`on a>'ition l'egontas; t~w d`e u<i~w t`hn <arm'ozousan tim`hn >aponemht'eon, t`hn >'anarqon a>ut~w par`a to~u patr`os g'ennhsin >anatij'entas; ka`i <ws >afj'asamen a>ut~w s'ebas >apon'emontes, m'onon e>usebos ka`i e>uf'hmws t`o @hn ka`i t`o `ae'i ka`i t`o pr`o a>i'wnwn l'egontes >ep> a>uto~u, t`hn m'entoi je'othta a>uto~u m`h paraitou'menoi, `all`a t~h e>ik'oni ka`i t~w qarakt~hri to~u patr`os >aphkribwm'enhn >emf'ereian kat`a p'anta >anatij'entes, t`o d`e >ag'ennhton t~w patr`i m'onon >id'iwma pare~inai dox'azontes, <'ate d`h ka`i a>uto~u f'askontos to~u swt~hros; »<o pat'hr mou me'izwn mo'u >estin«.}     \end{document}


title: Using boxes to define an adjusting (Dirac) bracket

text: I'd like to define a set of adjusting bracket, called in physics Dirac brackets. This brackets accept three arguments, separated by vertical lines, and all of them are enclosed by angles, e.g. in text format would by `<a|b|c>`. ## MWE A first try would be               \documentclass{article}     \usepackage{amsmath}     \usepackage{calc}          \newcommand\bkt[3]{\left< {#1} \left|{#2} \right| {#3} \right>}          \begin{document}          \begin{align}       \bkt{a}{b}{c}     \end{align}          \begin{align}       \bkt{a}{b}{\frac{c}{d}}     \end{align}          \end{document}      As can be seen in the picture, the middle brackets have not the desired size in the second case ![enter image description here](http://i.stack.imgur.com/ea2Kg.png) ## Attempt of a solution Creating a box with height equal to the max. height of the three arguments, and place the second argument inside the box should solve the problem... but I don't know if doing that is possible. Does anyone have an idea for solving my problem? Thank you, and (almost) Merry Christmas.


title: Keep getting an error with the code for this equation!

text: I've been trying to get this to work, but I keep getting errors saying `Paragraph ended before \end was complete.` I can't see where the issue is though. Could someone help?               \documentclass[12pt, a4paper]{article}     \usepackage{amsmath}     \usepackage[T1]{fontenc}          \begin{document}               When hydrogen is the fuel used:     \begin{equation*}     U_t=2249\ln \frac{1\times10^{6}{1\times10^6-424.6t}}     \end{equation*}          When kerosene is the fuel used:     \begin{equation*}     U_t=1737\ln \frac{1\times10^{6}{1\times10^6-1022t}}     \end{equation*}          When hydrazine is the fuel used:     \begin{equation*}     U_t=2025\ln \frac{1\times10^{6}{1\times10^6-1004t}}     \end{equation*}          \end{document}


title: Disappearance of the table title/caption, when using colortbl

text: I'm formatting a manuscript according to the PNAS style, as prescribed in http://www.pnas.org/site/authors/LaTex.xhtml When I color my table using the package `colortbl`, the title/caption disappears (the content of the table is just fine). From my testing, it seems the only way to get the title back is to remove `colortbl` package and `\cellcolor` from the table. I can speculate that there must be a conflict between `pnastwo` document class and `colortbl`, but I have no idea how to get around this problem. Has anyone experienced this? I appreciate your suggestions! FYI, I use MacOS X 10.6.8 and TeXShop 2.47               \documentclass{pnastwo}     \usepackage{colortbl,xr}          \begin{document}     \begin{article}     \end{article}          \clearpage     \begin{table}     \caption{TITLE}\label{LAB}     \begin{tabular}{ p{4.5cm} p{.8cm} | p{1.2cm}}     Name 1 & first & second \\ \hline\hline     value1 & \cellcolor[gray]{0.7}0.004 & 0.034 \\      value2 & 7721 & \cellcolor[gray]{0.7}0.14 \\      \end{tabular}     \end{table}          \end{document}


title: Excel2latex table running over page

text: I have a couple of tables in excel that i would put in my thesis. From this forum I learnt I could use excel2latex to export them into latex. Unfortunately when i tried, it is not working out as it should. The table goes over the page. I tried using `p{with}` but then latex complains with lot of errors. I have also tried `save as Latex` in Gnumeric with little success. Am I missing something? Here is an example of the table in excel and the resulting output from excel2latx![excel table](http://i.stack.imgur.com/svXXa.png) ![excel2latex output](http://i.stack.imgur.com/WC294.png) Thanks


title: Removing duplicates from a list

text: Is there a LaTeX kernel command to remove duplicates from a list? The list has the structure               \def\alist{john,mary,george,australia,australia}


title: Page is numbered on ToC but not on the page itself

text: you guys. I am working on my thesis and facing an annoying issue: I have to number the pre-Chapter1 pages with roman numbers and, after that, with arabian numbers. I've already tried several solutions and I don't know what else to do. My header is:               \documentclass[ruledheader]{abnt}     \usepackage[portuguese,ruled,vlined,linesnumbered]{algorithm2e}     \usepackage{hyperref}     \usepackage[portuguese]{babel}     \usepackage[latin1]{inputenc}     \usepackage[pdftex]{color,graphicx}     \usepackage{abnt-alf}     \usepackage[alf]{abntcite}     \usepackage{epsfig}     \usepackage{amssymb}     \usepackage{textcomp}     \usepackage{listings}     \usepackage{float}     \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{5}          \begin{document}          \DeclareGraphicsExtensions{.jpg,.pdf,.mps,.png}     \hypersetup{pageanchor=false}          \include{capa}     \include{folharosto}      These 'includes' on the last two lines are the page 1 and 2. I am also using the abnt document class, since it is the class that defines the brazilian thesis rules. So, I've tried the default configuration:               \tableofcontents     \pagenumbering{roman}     \listoffigures     \listoftables     \listofalgorithms          \begin{resumo}     ...     \end{resumo}          \begin{abstract}     ...     \end{abstract}          \pagenumbering{arabic}     \setcounter{page}{1}     \chapter{Introdução}     ...      However, the toc is showing roman and arabic mixed together, before the Chapter 1. Also, I didn't get the numbers on the lof and lot pages. Only the loa, resumo and abstract pages have numbers, but arabian ones: ![enter image description here](http://i.stack.imgur.com/BqHw6.jpg) The only way I get a correct toc is this one:               \tableofcontents     \pagenumbering{roman}     \listoffigures     \listoftables     \listofalgorithms     \pagenumbering{roman}     \setcounter{page}{5}          \begin{resumo}     ...     \end{resumo}          \begin{abstract}     ...     \end{abstract}     \clearpage          \pagenumbering{arabic}     \setcounter{page}{1}     \chapter{Introdução}     ...      And I get this: ![enter image description here](http://i.stack.imgur.com/s24AP.jpg) The \toc is correct, but even this way, the \lof and \lot don't have roman numbers on their pages. Actually these two never get page numbers, even if they are correct on \toc. The \loa, resumo and abstract pages have its roman page numbers showing correctly on its pages. What should I do in order to get the roman numbers on \lof and \lot showing on its pages? Regards, Davi. Ps: there is no \pagestyle{empty} in my text.


title: Inconsistent line spacing in beamer frametitle due to capital German umlauts

text: I have the following problem: Suppose I have a frametitle which takes two lines. Depending on whether the second line contains a character which uses the very upper part of the line like an 'Ü' (German umlaut), the space between the two lines differs. Switching slides, the second line of the title may jump up and down (which is unwanted :-)). As far as I have tested, this problem only occurs in the frame title and not for the body. I also found a post, describing a similar problem for chapter titles, but I wasn't able to figure out how to do this with beamer: titlesec: Vertical space that I don't want Any idea is very welcome! Edit: Here is an MWE:               \documentclass[mathserif]{beamer}     \usepackage[utf8]{inputenc}          \begin{document}          \begin{frame}       \frametitle{This is a very long frame title. There is no capital umlaut, so the spacing is ok.}     \end{frame}          \begin{frame}       \frametitle{This is another very long frame title. The following capital umlaut Ü changes the spacing.}     \end{frame}          \end{document}


title: Getting the page breaks right for a \beginsection macro

text: I've found this code in the question No indent in the first paragraph in a section in Plain TeX               \def\mysection#1{%       \goodbreak       \vskip2\baselineskip       \noindent #1\par       \nobreak       \vskip\baselineskip       \everypar={{\setbox0\lastbox}\everypar={}}}      but it doesn't stretch the bottom of the page when the page breaks on a new paragraph (here the stretching was found in the skips around the section title). ![The skips around the title are stretched when the page breaks around a \\mysection](http://i.stack.imgur.com/NMg32.png) So I tried               \def\mysection#1{%       \filbreak       \vskip2\baselineskip       \noindent #1\par       \nobreak       \vskip\baselineskip       \everypar={{\setbox0\lastbox}\everypar={}}}      which now encourages page breaks a bit too much... (The 2nd page was broken before the 3d section) ![with \\filbreak, the page breaks too easily around a \\mysection](http://i.stack.imgur.com/tp6Uk.png) Here is my question: how can I define a `\mysection` that   * breaks the page if (and only if) there is no space for the section title and the first line of the first paragraph of the section;   * ends the page with a `\hfil` if the page is broken on a section title? Test file:               \def\mysection#1{%         \filbreak         %\goodbreak         \vskip2\baselineskip         \noindent #1\par         \nobreak         \vskip\baselineskip         \everypar={{\setbox0\lastbox}\everypar={}}}          some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text           \mysection{Hello world!}     some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text           \mysection{Nice title!}     some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text           some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text           some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text           \mysection{This one too}     some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text           some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text      \bye


title: Issue with quotation marks

text: Quotation marks are showing up as symbols for me. I am using TeXstudio with pdflatex.exe. Here is a screenshot of my issue. I can list all the packages I am using if that helps. ![enter image description here](http://i.stack.imgur.com/7aqCU.png)


title: pdftitle and such ignored if specified after \maketitle with report and book classes, not with article class

text: The following MWE shows that, with `report` (and `book`) class, PDF information entries such as `pdftitle` specified thanks to `\hypersetup` are ignored if they are inserted after `\maketitle` (and not ignored if inserted before `\maketitle`).               \documentclass{report}     \usepackage{hyperref}     \begin{document}     \title{A Title}     \author{An Author}     \maketitle     \hypersetup{%       pdftitle=A PDF Ttitle,       pdfauthor=A PDF Author,       pdfsubject=A PDF Subject,       pdfcreator=A PDF Creator,       pdfproducer=A PDF Producer,       pdfkeywords=A PDF Keyword%     }%     \end{document}      It wouldn't be that surprising if it would be the case with all standard classes but, with `article` class, such PDF information entries are not ignored, no matter they are inserted before or after `\maketitle`. Is there a way to make such entries not ignored with `report` and `book` class, even if inserted after `\maketitle`?


title: Space between rows in mdframed environment

text: i'd like to reduce the space between two rows in an mdframed environment.               \mdfdefinestyle{round}{     innertopmargin=0pt,innerbottommargin=10pt,innerleftmargin=1pt,innerrightmargin=1pt,     middlelinewidth=3pt,innerlinewidth=0.4pt,outerlinewidth=0.4pt}          \begin{table}[tbp]     \label{tab:Liste}     \begin{mdframed}[style=round]     \caption{XXX}     \begin{multicols}{2}     {\RaggedRight                 \begin{enumerate}                     \item 1                     \item 2                     \item ...                 \end{enumerate}}             \end{multicols}     \end{mdframed}     \end{table}      I already tried, `skipbelow`, `skipabove` but none of them worked. Thanks in advance ![enter image description here](http://i.stack.imgur.com/M3Sh0.jpg)


title: Galaxy notes to tex files

text: anyone knows a program that converts notes from Galaxy note 10.1 to .tex files? I am more concerned about the formulas. I am also looking for a good program to convert MML to tex language.


title: How can I include SWF Animations in a document?

text: Minimal tex               \documentclass{article}     \usepackage{media9}          \begin{document}     \includemedia[       activate=pageopen,       width=200pt,       height=150pt     ]{}{Heartaxis.swf}     \end{document}      Everything runs fine in XeLaTeX typesetting engine apparently with the above code, but I see the animation as ![enter image description here](http://i.stack.imgur.com/Oryyh.png) I have previewed the result now in many viewers with same view. The background should be white, not dark grey. **How can you include SWF file in pdf?** Probably, some other file format than PDF has better support for SWF. PS or other?


title: How to escape properly and output regex in latex?

text: Escaping regex is a heck of a work on LaTeX. How should I write in latex syntax such that I can output the following regexes:               ^\(?\s?\w{1,5}\s*[):.]\s*      and               [\[\(].{1,}[\]\)]      I've tried `\text{[\\[\\(].{1,}[\\]\\)]}` but it gives compilation errors.


title: How can I highlight text before a character with listing?

text: All is in the title. I would like to add a color to the text before a character with listing package. For example, I would like to add a color to text between the beginning of a line and `:` or `=`, in a makefile. I tried to use `moredelimiters` but I did not succeed. ![enter image description here](http://i.stack.imgur.com/KyL4o.png)               \documentclass{article}          \usepackage{listings}     \usepackage{xcolor}     \definecolor{keycolor}{RGB}{172, 42, 42}     \definecolor{mbleu}{RGB}{64,96,127}     \definecolor{vimvert}{RGB}{46, 139, 87}          \lstdefinestyle{global}{       basicstyle=\ttfamily\scriptsize\color{black!90},%       stringstyle=\itshape\color{magenta},%       showstringspaces=false,%       keywordstyle={\bfseries\color{keycolor}},%       commentstyle=\color{blue}\slshape,%       framexleftmargin=1mm,%       backgroundcolor=\color{black!2},%     }          \lstdefinestyle{makefile}{       style=global,%       morecomment=[l][commentstyle]{\#},%       emphstyle={\color{vimvert}},%       moredelim=[s][emphstyle]{\$(}{)}%     }          \begin{document}          \begin{lstlisting}[style=makefile]     .SUFFIXES: .inc .f .f90 .F          # all CPP processed fortran files have the extension .f90     SUFFIX=.f90          #-----------------------------------------------------------------------     # this release should be fpp clean     # we now recommend fpp as preprocessor     # if this fails go back to cpp     CPP_=fpp -f_com=no -free -w0 $*.F $*$(SUFFIX)          vasp: $(SOURCE) $(FFT3D) $(INC) main.o          rm -f vasp         $(FCL) -o vasp main.o  $(SOURCE)   $(FFT3D) $(LIB) $(LINK)     makeparam: $(SOURCE) $(FFT3D) makeparam.o main.F $(INC)         $(FCL) -o makeparam  $(LINK) makeparam.o $(SOURCE) $(FFT3D) $(LIB)     zgemmtest: zgemmtest.o base.o random.o $(INC)         $(FCL) -o zgemmtest $(LINK) zgemmtest.o random.o base.o $(LIB)     dgemmtest: dgemmtest.o base.o random.o $(INC)         $(FCL) -o dgemmtest $(LINK) dgemmtest.o random.o base.o $(LIB)      ffttest: base.o smart_allocate.o mpi.o mgrid.o random.o ffttest.o $(FFT3D) $(INC)         $(FCL) -o ffttest $(LINK) ffttest.o mpi.o mgrid.o random.o smart_allocate.o base.o $(FFT3D) $(LIB)     kpoints: $(SOURCE) $(FFT3D) makekpoints.o main.F $(INC)         $(FCL) -o kpoints $(LINK) makekpoints.o $(SOURCE) $(FFT3D) $(LIB)          clean:           -rm -f *.g *.f *.o *.L *.mod ; touch *.F     \end{lstlisting}          \end{document}


title: Drawing lines in a plot and give them a label?

text: I am on my first adventure in plotting with LaTeX. I managed to get my bar chart plotted. I have two groups of values for which I want to show the average. I intend to put a horizontal bar over the bar chart and let it indicate the average values. Drawing is unfortunately not coupled to scaling or similar. In the moment I have to change something in the scaling/labeling everything will be out of its place. Is there a best practice way of drawing lines (or arrows) that are corresponding to data values of the underlying chart?


title: Fixed-width interword space

text: I would like to typeset `post--World War II` with what Adobe InDesign calls a "quarter space". The en-dash is there to be wider than a normal space, to clarify the constituent structure ([post-[[World War] II]]), but in good typesetting, the two spaces in this expression should, unlike other spaces in the same typeset line, not stretch. **How do I typeset a fixed-width "quarter space" in LaTeX?** (I used to think that the right way was `post--World\ War\ II`, but I just found out that `\␣` isn't a fixed space at all but is just a line-breaking variant of the `line␣break--preventing` `~`.) Really, I need two different macros: one that allows for a linebreak and one that doesn't. For example, the expression above should be linebroken in the following ways:   * ok: `post--`/`World␣War␣II`   * ok: `post--World`/`War␣II`   * bad: `post--World␣War`/`II` (Let's just assume that this is how we want it and leave the question of whether the second linebreak option is typographically good or not for another debate.) Let's also assume that linebreaking points in a component word are to be retained. Two examples (from Wikipedia's "Dash" article):   * "Fran·cis·co" in `non--San␣Francisco`   * "min·is·ter" in `ex--prime␣minister` Related:   * about `~` and `\␣` (which don't help here): Difference between control space and non-breaking space   * about various ways to produce spaces in LaTeX: Lengths and when to use them


title: Exhaustive list of use cases for the interword space \␣

text: The Guide to LaTeX (4e) states that `\␣` is a "[n]ormal space between words after a command without arguments or after a period that is not the end of a sentence" (p. 467). For the former case (`\somecommand\ nextword`), there is `{}` (`\somecommand{} nextword`), and for the latter case, there is `\@` (used as `.\@`, not `\@.`!). **So why would one use`\␣` at all?** Is `\␣` perhaps not needed in LaTeX? When is `\␣` really the best macro to use (better than the alternatives `{}` and `\@`)? Note: `~` is for creating an interword space that cannot be line-broken, such as in `Dr.~Smith`; there are a number of other use cases (`figure~\ref{...}` and such), and they have been enumerated elsewhere, but the precise list is not important here (see links below). Related:   * (meant-to-be-)exhaustive list of use cases for `\@`:      * an answer to "When should I use intersentence spacing (`\@')?" with     * user egreg's brilliant observation that `\@` can destroy italic correction   * (meant-to-be-)exhaustive list of use cases for `~`:      * an answer to "When should I use non-breaking space?" and     * an answer to "What is the right way to use of non-breakable space before math expressions?"     * **Note that these follow Knuth's personal taste, which is not necessarily known or followed at all outside of the TeX community!** There is good judgment behind his recommendations, but it's unclear whether not following them is much of a problem; one also needs to balance this against too much interword spacing. For example:        * The Chicago Manual of Style's online Q&A writes somewhere in the "Manuscript Preparation" section: "CMOS does not prohibit a numeral at the beginning of a line, but if in a given context the numeral looks confusing, by all means mark it to be brought up."


title: Static node distance tikz matrix of math nodes

text: I would like to draw the following diagram in tikz,                   \documentclass[b5paper,10pt,twoside]{book}         \usepackage[hmarginratio=1:1]{geometry}         \usepackage{tikz}         \usetikzlibrary{arrows,calc,through,backgrounds,matrix,decorations.pathmorphing}         \begin{document}              \begin{center}         \begin{tikzpicture}         \matrix(m)[matrix of math nodes, row sep=2em, column sep=2em, text height=1.5ex, text depth=0.25ex]         {X        & \,        & Z         & \,        & Z/Y      & \,       & (Y/X)[1]   \\         \,        & Y         & \,        & Z/X       & \,       & Y[1]     &         \,         \\         \,        & \,        & Y/X       & \,        & X[1]     & \,       &         \,         \\};         \path[->,font=\scriptsize]         %top arrows         (m-1-1) edge[bend left =45] node[above] {$g\circ f    $} (m-1-3)         (m-1-3) edge[bend left =45] node[above] {$            $} (m-1-5)         (m-1-5) edge[bend left =45] node[above] {$\theta      $} (m-1-7)         %lower edge border arrows         (m-1-1) edge                node[below] {$            $} (m-2-2)         (m-2-2) edge                node[below] {$            $} (m-3-3)         (m-3-3) edge[bend right=45] node[below] {$            $} (m-3-5)         (m-3-5) edge                node[below] {$            $} (m-2-6)         (m-2-6) edge                node[below] {$            $} (m-1-7)              %completing second dt         (m-2-2) edge                node[below] {$            $} (m-1-3)         (m-1-5) edge                node[below] {$            $} (m-2-6)         ;         \path[dashed,->,font=\scriptsize]         (m-1-3) edge                node[above] {$            $} (m-2-4)         (m-2-4) edge                node[above] {$            $} (m-3-5)              (m-3-3) edge                node[above] {$            $} (m-2-4)         (m-2-4) edge                node[above] {$            $} (m-1-5)         ;         \end{tikzpicture}         \end{center}              \end{document}      But it seems like, since the text in the right nodes are longer than the text in the left nodes that, the gadgets "pizza slices" on the left are smaller than the gadgets on the right. ![enter image description here](http://i.stack.imgur.com/sOl1d.png) Does anyone know how to force the distances between the nodes to be equal, that might work in this particular diagram. For some other diagrams in the same document I guess that I cannot change the premable. Cheers!


title: How to define a command that surronds an argument with parenthesis if it contains a comma?

text: I have a very simple command in which one of the arguments can contain commas, in which case the output may not be easily readable since the text in which it is used may contain other commas, making it non-obvious where that notation ends. Unfortunately I often forgot to surround this argument with parenthesis, hence the confusion. How can I redefine that command so that all its occurrences produce the good- looking output(i.e. exactly one pair of parenthesis is used _if_ it contains commas)? * * * The particular command is:               \newcommand{\SubSeq}[3][\empty]{{#2 \upharpoonright #3}^{#1}}      And the argument that might contain a comma is `#3`. * * * **Edit:** I don't really care for more complicated situations like `(a,b),c,d`, you can assume that the input either has parenthesis surrounding the whole argument, or it doesn't have any parenthesis. _However_ , I'd agree that in _ideal_ solution I'd like to have parenthesis every time that there's a comma outside delimiters in the argument. (And you can definitely assume delimiters are well matched) * * * Thanks to all who contributed answers! I decided to accept Qrrbrbirlbel's answer because is the most simple solution that achieve the functionality I wanted, but I'm **really** grateful to all of you.


title: the problem about putting one picture on the left and another on the right

text: I wish to put two graph together, one is on the left side, the other is one the right side. I use "minipage". However, using the below code, the first graph is on the top of the second graph. May some one help me? Here is my code:                \documentclass[tikz]{standalone}         \usepackage{tikz}         \usepackage{scalefnt}         \usetikzlibrary{shapes}         \begin{document}         \begin{figure}[htbp]         \hspace{-4mm}         \begin{minipage}{0.5\linewidth}]         \centering         %\includegraphics[width=2.3in]{image/CompositionalStucture}         %\input{trans}         \tikzset{          block/.style = {circle, draw,align=center,inner sep=0pt},          line/.style = {draw,->},          }         {\scalefont{1}         \begin{tikzpicture}[node distance=10mm]         \node[block,minimum size=3mm](s2) {1};         \node[block,right of =s2,anchor=center,minimum size=2mm] (s3){2};         \node[block, right of=s2,anchor=center,,minimum size=3mm] (s4) {};              \path[line] (-0.8,0)-- (s2){};         \path[line] (s2)-- node[above]{stop}(s4);         \path[line] (s2) to [out=120,in=40,looseness=5] node[above] {$\Sigma$}(s2);         \path[line] (s4) to [out=120,in=40,looseness=5]node[above] {$\Sigma$}(s4);         \end{tikzpicture}         }         \caption{Travel Agency Service (\TAS{})}         \label{fig:TAS}         \red{2}         \end{minipage}              \begin{minipage}{0.5\linewidth}         \centering         %\includegraphics[width=2.3in]{image/CompositionalStucture}         %\input{trans1}         \tikzset{          block/.style = {ellipse, draw,align=center,inner sep=0pt},          line/.style = {draw,->},          }         {\scalefont{1}         \begin{tikzpicture}[node distance=10mm]         \node[block,minimum size=3.5mm](s1) {(6,1)};         \node[block,minimum size=3.5mm,below of =s1](s2) {(7,1)};         \node[block,minimum size=3.5mm,below of = s2](s3) {(22,2)};              \path[line] (s1)-- node[right]{gc}(s2);         \path[line] (s2)-- node[right]{TER}(s3);         \end{tikzpicture}         }         \caption{Travel Agency Service (\TAS{})}         \label{fig:TAS}         \red{3}         \end{minipage}         \end{figure}         \end{document}


title: Illegal unit of measure (pt inserted) \end{document}

text: By looking at questions with same title as mine, I unfortunately don't find answers to fix my code. I am not too familiar with LaTex, but after reading several webpages I really can't see what I am doing wrong. It seems as if the error message in the title appears whenever my document is taking in use the second page. Therefore I give you a full copy of my code to have the 'critical' mass of text to look at. There sholdn't be any problems before the '\newpage' command (the last 7 lines i the code), but as I am not yet the biggest LaTex shark my preamle might be the one causing all the troubles. Can anyone figure why I get this error message when compiling? And what can I do to fix the problems? So here is my total code:                   \documentclass[a4paper,11pt]{article}         \usepackage[utf8]{inputenc}         \usepackage[danish]{babel}         \usepackage[T1]{fontenc}         \usepackage{graphicx}         \usepackage{amsmath, amssymb}         \usepackage{url}         \usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}         \usepackage{geometry,fancyhdr}         \usepackage{ulem} %for dobbelt understregning af resultater brug \uuline{}         \usepackage[font=footnotesize,labelfont=bf]{caption}              \usepackage{mathtools}         \pagestyle{fancy}         \fancyhf{}         \lhead{Malte Bødkergaard Nielsen, hold 9}         \cfoot{Side \thepage\ af \pagetotal}         \geometry{headheight=2cm}         \setlength{\jot}{10pt}              \title{\textbf{Analyse 0\\ Obligatorisk opgave 2\\}}         \author{\emph{Malte Bødkergaard Nielsen} \\ \\Hold 9}         \begin{document}         \thispagestyle{empty}         \section*{Opgave 1}         Hyperbolsk cosinus og sinus er givet ved:         \begin{align*}         \cosh(x)=\frac{e^{x}+e^{-x}}{2} &&,&& \sinh(x)=\frac{e^{x}-e^{-x}}{2} && \text{for $x\in\mathbb{R}$}         \end{align*}         Dermed findes den afledte for $\cosh(x)$ og $\sinh(x)$ vha. sætning 4.9, der fortæller os, at hvis $f$ og $g$ er differentiable i et punkt $a$, så vi $h=f+g$ også være det. Således kan vi splitte $\cosh(x)$ og $\sinh(x)$ op i en sum af to eksponentialfunktioner, og de hyperbolske funktioners differentiabilitet afhænger dermed af eksponentialfunktionens differentiabilitet.\\         Yderligere må vi benytte sætning 4.11 (kædereglen), der fortæller, at hvis $g_1$ er differentiabel i et punkt $a$, og hvis $g_2$ er differentiabel i et punkt $b=g_1(a)$, så vil $g_2\circ g_1$ være differentiabel i $a$.\\         Sætningerne 4.9 og 4.11 oversættes til at gælde for funktioner, der er differentiable i alle punkter $x\in I$.\\         Det følger af eksempel 4.5, at $\exp'(x)=\exp(x)$. Af eksemplet ses nemt, at vi kan gange enhver konstant $k_1$ på eksponentialfunktionen, og jvf. eksemplets argumentation opnå, at $(k_1\cdot\exp(x))'=k_1\cdot\exp'(x)=k_1\cdot\exp(x)$.\\         Dermed har vi:         \begin{align*}         && f(x)=\frac{1}{2}\cdot e^{x} &&,&& g(x)=g_2\circ g_1 && \text{for $x\in\mathbb{R}$}\\         \text{hvor} && g_1(x)=-x &&,&& g_2(y)=\frac{1}{2}\cdot e^{y} && \text{for $x,y\in\mathbb{R}$}         \end{align*}         Kædereglen giver os nu:         \begin{align*}         g'(x)=(g_2\circ g_1)'(x)=g_2'(g_1(x))\cdot g_1'(x)= \frac{1}{2}\cdot e^{-x}\cdot (-1)= -\frac{1}{2}\cdot e^{-x}         \end{align*}         For at udregne $g_1'(x)$ har vi benyttet resultatet fra eksempel 4.2, hvor det vises, at $x^{k}$ differentierer til $k\cdot x^{k-1}$. Resultatet fra dette eksempel ses at kunne ganges med en vilkårlig konstant $k_1$, således at $(k_1\cdot x^{k})'=k_1\cdot k\cdot x^{k-1}$.\\         Med alle disse brudstykker får vi:         \begin{align*}         \cosh(x)=\frac{e^{x}+e^{-x}}{2}=f(x)+g(x)=f(x)+(g_2\circ g_1)(x)\\         \Rightarrow\cosh'(x)=f'(x)+g'(x)= \frac{1}{2}\cdot e^{x} + \left(-\frac{1}{2}\cdot e^{-x}\right) =\frac{e^{x}-e^{-x}}{2}=\sinh(x)\\         \text{for $x\in\mathbb{R}$}         \end{align*}         På samme vis får for $\sinh(x)$:         \begin{align*}         \sinh(x)=\frac{e^{x}-e^{-x}}{2}=f(x)-g(x)=f(x)-(g_2\circ g_1)(x)\\         \Rightarrow\sinh'(x)=f'(x)-g'(x)= \frac{1}{2}\cdot e^{x} - \left(-\frac{1}{2}\cdot e^{-x}\right) =\frac{e^{x}+e^{-x}}{2}=\cosh(x)\\         \text{for $x\in\mathbb{R}$}         \end{align*}         \newpage         Hyperbolsk tangens er givet ved:         \begin{align*}         \tanh(x)=\frac{\sinh(x)}{\cosh(x)}=\frac{\frac{e^{x}-e^{-x}}{2}}{\frac{e^{x}+e^{-x}}{2}}=\frac{e^{x}-e^{-x}}{e^{x}+e^{-x}} && \text{for $x\in\mathbb{R}$}         \end{align*}         Det ses, at $\tanh(x)=\frac{f(x)-g(x)}{f(x)+g(x)}=\frac{h_1(x)}{h_2(x)}$, hvor $h_1(x)=f(x)-g(x)$ og $h_2(x)=f(x)+g(x)$.         \end{document}      Best regards


title: How to put a \clubsuit at the end of an example

text: I was wondering if there was an easy set of code that allows the standard `\begin{example}` `\end{example}` environment in `amsthm` to have the extra feature that it right-aligns a `\clubsuit` at the end of the example? Similarly, I would like to perform the exact same modification to the remark environment but with a `\diamond` instead of a `\clubsuit`.


title: How to create an optional argument like the 'correctchoice` command in exam document class?

text: I want to create an alternative to `CorrectChoice`. That when `[answers]` command is used it will highlight the correct answer and be printed with the question together. I have seen this command by this link How to box the correct answer in Exam class?. it created a command `MyCorrectSmartChoice` I am thinking on if the `[answers]` command will not be included, how will the function(puting the correct answer inside the box) of this particular command be hidden?? example:               \documentclass[answers]{exam}     \begin{document}          \begin{questions}     \question The question is here.          \begin{choices}     \choice one      \MyCorrectSmartChoice two      \choice three          \end{choices}     \end{questions}          \end{document}      Then if the `[answers]` command will be used, it will be emphasized? Need some help on this matter. Thanks!


title: Feynmf problem with OSX

text: i found a problem using the package feynmf on OSX 10.6.8 using MacTeX-2013 distribution. I've checked the presence of the two packages feynmf and feynmp using the utility, but when compiling the simple code for this expample i get back this error:               LaTeX Error: Command \c@fmfgraph already defined.                Or name \end... illegal, see p.192 of the manual.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.     ...                                                        l.117 \newcounter{fmfgraph}


title: Making AUCTeX aware of the TeX engine set in master file

text: Is there a way to make AUCTeX aware of the TeX engine local variable set in a master file when I compile from other files? `master.tex`:               \documentclass{minimal}     \usepackage{fontspec}          \begin{document}       \input{content}     \end{document}          %%% Local Variables:     %%% mode: latex     %%% TeX-engine: luatex     %%% End:      `content.tex`:               Here is some content.          %%% Local Variables:      %%% mode: latex     %%% TeX-master: "master"     %%% End:      When I am inside `content.tex` and pres `C-c C-c`, AUCTeX runs `pdflatex` and not `lualatex`.


title: Print zeroes in a sparse matrix in a lighter color

text: For a report I need to print some sparse matrices as full matrices, so that means that there are a lot of zeroes. If I print them in the same color as the meaningful entries, it doesn't look very organized. And when I don't print the zeroes at all, it also doesn't look that good. So I'd like to print the zeroes in a lighter color. Of course I could define a color (e.g. \definecolor{lightgrey}{RGB}{200,200,200}, and then for each 0 write \textcolor{lightgrey}{0}. But this is not very efficient. It is also possible to define a new command, preferably with a short name, that just inserts the grey colored 0. But I wonder, is there another, cleaner way to accomplish this? MWE for a relatively small matrix:               \documentclass[10pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \begin{document}          \begin{align}     \left(\begin{array}{ccccccccc}      1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\      0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\      0 & \frac{1}{2} & \frac{1}{2} & 0 & 0 & 0 & 0 & 0 & 0\\      0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\      0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\      0 & 0 & 0 & 0 & \frac{1}{2} & \frac{1}{2} & 0 & 0 & 0\\      0 & 0 & 0 & \frac{1}{2} & 0 & 0 & \frac{1}{2} & 0 & 0\\      0 & 0 & 0 & 0 & \frac{1}{2} & 0 & 0 & \frac{1}{2} & 0\\      0 & 0 & 0 & 0 & \frac{1}{4} & \frac{1}{4} & 0 & \frac{1}{4} & \frac{1}{4}      \end{array}\right)     \end{align}          \end{document}


title: Explanation of code using \titleformat

text: I am writing a project in latex and to make my output pdf look more fancy i am using a "Fancy chapter headings with TikZ" code found here http://texblog.net/latex-archive/layout/fancy-chapter-tikz/ (thx to author). But the thing is I don't want to just use it, I also want to understand it. I have never used titlesec package before so that's why i need your help. Can you give some short explanation to every line or at least answer some additional questions i have put in comments?Those are more imporatnt :) I will really appreciate your help and effort. THANK YOU Here's the code from that page:               \documentclass[svgnames]{report}     \usepackage{tikz}     \usepackage{kpfonts}     \usepackage[explicit]{titlesec}          %EXPLANATION FROM HERE     \newcommand*\chapterlabel{}     \titleformat{\chapter}       {\gdef\chapterlabel{}        \normalfont\sffamily\Huge\bfseries\scshape}       {\gdef\chapterlabel{\thechapter\ }}{0pt}       {\begin{tikzpicture}[remember picture,overlay]         \node[yshift=-3cm] at (current page.north west) % why is here used current page.north west?           {\begin{tikzpicture}[remember picture, overlay]             \draw[fill=LightSkyBlue] (0,0) rectangle               (\paperwidth,3cm);             \node[anchor=east,xshift=.9\paperwidth,rectangle,                   rounded corners=20pt,inner sep=11pt,                   fill=MidnightBlue]                   {\color{white}\chapterlabel#1}; %why is here used argument by \chapterlabel?            \end{tikzpicture}           };        \end{tikzpicture}       }     \titlespacing*{\chapter}{0pt}{50pt}{-60pt}          %TO HERE          \begin{document}     \tableofcontents     \chapter{Introduction}     Text     \chapter{Main}     \section{Section}     Text     \begin{thebibliography}{99}     \bibitem{Test} test reference     \end{thebibliography}     \end{document}


title: Aligning text vertically in Tikz

text: I need to know the correct way of handling vertical alignment in TIKZ. Let me elaborate an example:               \documentclass{article}     \usepackage{amsmath,tikz}     \begin{document}     \begin{tikzpicture}               \node (A1) at (0,4) {($\overset{\surd}{1}$ \indent 2)};               \node (B1) at (0,3) {($\overset{\surd}{3}$ \indent 4)};                    \node (A) at (2,4) {$\phi_1$} ;               \node (B) at (2,3) {$\phi_2$} ;                    \draw [->, line width=1pt] (A) -- (A1)             node [near start, above]                 {                     \footnotesize{R1}                 };                      \node (A2) at (6,4) {$7^1$ \indent $8^1$ \indent $3^1$ \indent $4^1$\indent $\parallel$ 2};                 \node (B2) at (6,3) {$1^3$ \indent $2^3$ \indent $5^3$ \indent $6^3$\indent $\parallel$ 4};                      %fake caption                 \node at (8,4.5) {fake};          \end{tikzpicture}      Which results in this:   ![Output of the code](http://i.stack.imgur.com/TyQMN.jpg) I just want to know is ther any way to force the lines into a bottom line here so that `$\phi_1$` and the left would be aligned? Should I use phantom to do so or is there any thing better I am unaware of?   The next point is about the word "fake" in the top right corner. I want it over the "2" but I have placed it as a node. I could use `\overset{fake}{\overline{2}}` to have a "fake" above the "2" but it pushes the line to the left which is not desired. And as you might have guessed I also need a line between "fake" and "2" should I use `\overline{2}`?


title: How to make CircuitTikZ symbols smaller

text: Is there a way to make symbols of the CircuitTikz package smaller (like ports). Using small/tiny as argument doesn't help.


title: generalize \iftoggle in etoolbox

text: I am using nested loop conditional `\iftoggle` of `etoolbox`, is there any other generalized conditional? Usually it works as:               \newtoggle{name}     \settoggle{name}{true}     \iftoggle{name}{do if name is true}{do if name is false}      Now, I would like something like:               \newtoggle{name} % with 5 options, for example     \settoggle{name}{option3} % all the other option are false     \iftoggle{name}{do if option1 is true}{do if option2 is true}{do if option3 is true}{do if option4 is true}{do if option5 is true}      I know there is a solution with nested conditional, but maybe there is other direct solution. Any idea?


title: Margin notes (or todo's) in ACM Transactions template

text: I want to add margin notes to a document I'm writing in the ACM Transactions format (it's still in draft form). However, it's quite difficult to use existing packages such as todonotes (which looks great) or ed, since the notes will always overfill the margins (resulting in compile errors). Any idea what I can do about this? Thanks!


title: Create learning cards

text: Is there a document class available that allows for the creation of learning cards? I thought of an environment that allows me to define a question and the according solution. The final document has for example 6 questions on every even page and the according 6 answers on every odd page -> I can simply cut out the learning cards.


title: Are there any packages that I should not be using with ifthen package

text: I am new to TeX and I started adding package files to prepare my document without worrying about conflicts. I am asking this subjective question because I am not sure if I can post entire document preamble here. Any generic tips would be of big help. I uploaded my package definition to google docs. I am getting extra white space with `\ifthenelse` which I highlighted with a circle in the attached image. I tried using just the ifthen package and commands and it works just fine.               \documentclass[fleqn,12pt,a4paper]{article}     \usepackage{mypackage}     \begin{document}     \Vibhakti{11} \& \Vibhakti{52} \& \Vibhakti{73}     \end{document}      (This should be compiled with `xelatex`.) ![example](http://i.stack.imgur.com/Tddfr.jpg) I am not sure if I am using any package that I should not be...


title: Cylinder shading with PGF/TikZ

text: I'm trying to create a cylinder with 3D shading effects. The cylinders in the picture are standing vertically, and have a body and an end. I'd like the body to be shaded so that it varies uniformly from dark on the left side of the cylinder body to light in the middle (facing the viewer) to dark on the right again (light shading effect). The color should remain the same in a vertical direction. If the same is possible for the cylinder end that would be nice, but it is not so important. I did some experimentation. Cylinder A below has some shading effect, but I have no idea how I got it. I don't even know whether it makes sense to use shade as an argument to a node, except that it is clearly doing something. Cylinder B is similar to what I want, except for the shading effect. This was tested with PGF 2.0 and Tex Live 2009 on Debian squeeze.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes.geometric,decorations.fractals,shadows}     \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}     \begin{document}     \pagestyle{empty}     \begin{tikzpicture}         \tikzset{draw, name=s, shape=cylinder, line width=0.1cm, shape         border rotate=90, aspect=.2, inner xsep=3cm, inner ysep=2cm,         cylinder uses custom fill, cylinder end fill=blue!25, cylinder         body fill=blue!40};       \node [aspect=0.25, shade={left color=red!20,right color=blue!50}] at (1,0) {A};       \node[aspect=0.10] at (10,0) {B};     \end{tikzpicture}     \end{document}


title: Is it possible to disable old style numbers for specific cases?

text: Is there a way to disable old style numbering only for specific cases? Right now I have old style numbering enabled globally for my whole document via `\usepackage[osf]{libertine}`, but I want to disable it only for one block of text. I am hoping there is a way to simply disable old style for that block of text (which has numbers scattered throughout it) rather than having to add `\somecommand{123}` for each number instance in the block of text.


title: Not allowing hyphenation of urls in references

text: Is there a way to globally turn off hyphenation of links in bibliography? Current state doesn't please me: ![current state](http://i.stack.imgur.com/16cCd.png) Minmal working example:               \documentclass[12pt,a4paper,oneside]{report}      \usepackage{url}     \usepackage{apacite}     \usepackage[T1]{fontenc}      \usepackage[osf]{libertine}     \begin{document}          \cite{mchinen}          \bibliographystyle{apacite}      \bibliography{general}     \end{document}       and here is the general.bib entry:               @url{mchinen,     Author = {Chinen, Michael},     Date-Added = {2013-05-01 10:12:23 +0000},     Date-Modified = {2013-05-01 10:34:20 +0000},     Lastchecked = {March 23, 2013},     Title = {{M}ichael {C}hinen},     Url = {http://michaelchinen.com},     Urldate = {March 23, 2013},     Year = {2013},     Bdsk-Url-1 = {http://michaelchinen.com}}


title: article has no publisher in biblatex

text: Why is there no **publisher** field on the article entry type in biblatex? I am using biblatex to create my bibliography, however I can't seem to figure out how to reference a publisher in an article Entry Type. For example:               The Golden Ratio: A Contrary Viewpoint     Clement Falbo     The College Mathematics Journal     Vol. 36, No. 2 (Mar., 2005), pp. 123-134      (article consists of 12 pages)     Published by: Mathematical Association of America      How should I include the information about Mathematical Association of America in my entry?


title: Columns with Latex code and Output in a Beamer presentation

text: I am new to Latex and am working on a small presentation using Latex and Beamer. In one frame, I'm trying to show some Latex code and it's output. Initially I just took a screenshot of the Gummi tex code and preview panel, but I wanted to know how I can get just the code on one column and the output on another side of the frame. I've seen this in several presentations and can't seem to find anything via google or any of the tutorials I'm using. Can anyone help me with spliting a beamer frame with Latex code on one side and the output on the other? For what it's worth, I'm working in Ubuntu 10.10


title: Rendering MathML in LaTeX?

text: I have MathML that I need to render in my LaTeX document. Is there a recommended way of doing so? So far, from googling, I've found MathParser - a Java converter. But I was hoping there might be a better way to do it.


title: Wordwrap in Kile?

text: I can't seem to wrap my words to the size of the window in the IDE Kile. This results in my line of LaTeX being very long and ridiculous and the kile window scrolling to the right. Any suggestions?


title: German quotation marks are broken in XeLaTeX

text: Although I known nothing about German, I have to complie some German TeX documents. The German quotation marks `"'` or `\grqq` and `"'` or `\grqq` in my document are replaced by cmr font and the PDF file is not copyable near the quotation marks. A warning message says > font shape `OT1/TeXGyrePagella(0)/m/n' undefined, using `OT1/cmr/m/n' > instead for symbol `glqq' on line 9. The following is my minimal example:               % !TEX program = xelatex     % !Mode:: "TeX:UTF-8"     \documentclass[12pt]{article}     \usepackage[ngerman]{babel}     \usepackage{fontspec}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont{TeXGyrePagella}     \begin{document}     These are German \glqq quotation marks\grqq.     \end{document}


title: Could you represent this sort of network graph, using latex?

text: This came up on a rpg.stackexchange question, as an option to represent relations between character with a graph from this PDF where: > Every node of this graph is another person who "[who] can do something > useful that your character can’t; they’ll ask for something in return." By > indicating the from of the relationship and the utility of the relationship > in the graph, a very simple social network can be depicted. As players play, > changes in the relationship map (page 4) represent real character > development. The suggestion from the answer is: > To adopt this for a longer game, keep the same map principle and continue > drawing in pen. By indicating additional likes and dislikes (also > accompanied by a want/need descriptor and potentially in a subgraph if > things are too fiddly) you can see easily the predominant attitude of an NPC > towards anyone else (is it mostly blue? Is it mostly red? Is it thick? Is it > thin?) I was thinking such a graph could be made via LaTeX, and the .tex file would simply be edited for each change to the graph. As relationships grow the lines thicken or thin, and more people are added. **Would this be possible, and would this be easy to use, after rigging up with a template?**


title: Customizing layout and typesetting with Latex, what I need to know?

text: I've been using LaTeX sparingly in the last years to write lab reports, my thesis etc. I've always had a problem with layout customization and typesetting in general. I would like to fine tune each aspect of the page, from the title, to the headings, footnotes, fonts and so on like I do, for example, in a publishing software such as Scribus. I've found that there are a lot of customization possibilities, as shown in the most beautiful LaTeX documents around in the web. What things do I have to study in order to be able to customize LaTeX (say, write a custom class)? For example do I have to learn TeX very well? Should I move on some graphic package?


title: When to indent a paragraph?

text: I use indentation of the first line for paragraphs. When a new paragraph starts after a code listing (or some other figure), this looks a bit unpleasant to me. What is the typographical convention for this? Is it OK to use `\noindent` to supress the indentation?


title: chktex not reading lines correctly

text: I'm trying to use `chktex` in Ubuntu but it seems to not be reading lines correctly. When I run it on a file that has this line (and any other line like it):               \include{glossary}      it send an error saying (note that it replaces the char before last in the file name with the last char! - **glossayy** )               chktex: WARNING -- Unable to open the TeX file `glossayy'.     Warning 27 in book.tex line 158: Could not execute LaTeX command.     \include{glossary}        % Glossary        ^^^^^^^^      Any ideas why this happens?


title: sorting multiple bibliographies in biblatex

text: I have a thesis which has two bibliographies. It includes a list of publications and a reference list. The reference list should be unsorted, or rather, sorted in order of appearance, while the list of publications should be sorted by date. I have used biblatex to do this. To sort the references by order of appearance I have used the sorting=none option in the preamble, and I have generated the list of publications by using               \nocite{*}     \printbibliography[keyword=pub]      but have noticed that this in fact sorts the publications by name. I have seen this: biblatex style with multiple bibliographies in one document, which seemed to indicate that sorting separate bibliographies with different sorting options was a coming feature. I just updated biblatex now, and it doesn't seem to be here yet. Is there some way of forcing the list of publications to be sorted by date? I tried setting the presort, sortkey and sortname fields manually, but that did not seem to work. Any hack solution while waiting for the new biblatex version would be appreciated.


title: LuaLaTeX and counters

text: I'm trying to use values from expanded macros within a direct lua block, but I can't figure out how to get a value from any macro that has braces in it.               \directlua { tex.print(\value{footnote}} }       Never works the way i expect it, All i want it to do is for it to print out the current value of the counter footnote. Do I need to escape the braces? A minimal example that doesnt work:               \documentclass[12pt, a4paper]{article}     \usepackage{geometry}     \geometry{a4paper}     \usepackage{graphicx}     \usepackage{epstopdf}     \begin{document}     \footnote{hello}     \directlua { tex.enableprimitives('',tex.extraprimitives()) }     \catcode `\{=1     \catcode `\}=2     \directlua { here = here or {}; here.foo = 5 }     \directlua { here = here or {}; tex.print(here.foo + 5) }     \directlua { tex.print(\value{footnote}} }     \end{document}      And the errors;               *geometry* driver: auto-detecting     *geometry* detected driver: pdftex     (/usr/local/texlive/2010/texmf-dist/tex/context/base/supp-pdf.mkii     [Loading MPS to PDF converter (version 2006.09.02).]     )     ! LuaTeX error <\directlua >:1: unexpected symbol near '\'.     l.13 \directlua { tex.print(\value{footnote}}                                                   }     ?       \


title: Does tikz 2.1 no longer work with the preview package?

text: I used to be able to create png images of diagrams made with tikz code by using the preview package and printing the dvi output from dvips to a png file using ghostscript. The latest version of tikz seems to have broken this ability in some way. If I use the following latex code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{arrows,snakes,backgrounds,patterns,matrix,shapes,fit,calc,shadows,plotmarks}     \usepackage[graphics,tightpage,active]{preview}     \PreviewEnvironment{tikzpicture}          \begin{document}     \begin{tikzpicture}         \draw (0,0) rectangle (1,1);     \end{tikzpicture}     \end{document}      I then run Latex to get the dvi file, and dvips to convert to postscript. I then run ghostscript to produce the png with the following command:               gswin32c.exe -sDEVICE=png16m -dTextAlphaBits=4 -r300 -dGraphicsAlphaBits=4 -dSAFER -q -dNOPAUSE -sOutputFile="tikz_preview_png_problem.png" -f "tikz_preview_png_problem.ps"      Previous to tikz 2.1 this worked fine, but now produces the following output:               Error: /undefined in pgfo     Operand stack:          Execution stack:        %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-     -   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa     lse   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_     pop   1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval-     -   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringv     al--   2   %stopped_push   --nostringval--     Dictionary stack:        --dict:1161/1684(ro)(G)--   --dict:0/20(G)--   --dict:74/200(L)--   --dict:95     /300(L)--     Current allocation mode is local     Last OS error: No such file or directory     Current file position is 9094     GPL Ghostscript 8.71: Unrecoverable error, exit code 1      Is there any way to get around this, it's a pain in the bum as I liked to be able to produce high res png of my vector graphics for use in non-latex docs or websites etc. I'm using Miktex on windows with Texniccenter as my editor in case it is relevant.


title: How to improve the glowing effect in this figure using TikZ?

text: I want to improve the glowing effect in the MWE below. As shown in the output there is like a sharp transition between the white circle in the center and the surrounding halo, which does not give the desired effect of having a smooth transition to simulate a natural light. I don't know how TikZ enthusiasts would approach this matter in order to improve the glowing effect? in other words, how far TikZ can go with the glowing effect? **Note**   Please keep the diameter of all circles fixed, but you can adjust fading width, the most important point is not to show the empty space at the confluence of the colored circles, I want it to be _completely_ hidden behind the white glowing light, I hope. **MWE Code**               \documentclass[border={0pt 0pt 0pt 0pt}]{standalone}      \usepackage{graphicx,xcolor}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows,shadings,decorations.text,shadows,fadings}      \tikzfading[name=fade out,inner color=transparent!0,outer color=transparent!70]     \begin{document}     \begin{tikzpicture}[line cap=round,line join=round,very thick,>=triangle 45,x=1.0cm,y=1.0cm,align=center]          \draw [color=black,fill=blue!50!black,fill opacity=1.0] (0,2) circle (1.4cm) node (12oclock){};      \draw [color=black,fill=blue!20!black,fill opacity=1.0] (-1.9,0.62) circle (1.4cm) node (10oclock){};     \draw [color=black,fill=green!50!black,fill opacity=1.0] (-1.18,-1.62) circle (1.4cm) node (8oclock){};     \draw [color=black,fill=orange!50!yellow,fill opacity=1.0] (1.18,-1.62) circle (1.4cm) node (5oclock){};     \draw [color=black,fill=red,fill opacity=1.0] (1.9,0.62) circle (1.4cm) node (2oclock){};     \draw [color=white,fill=white,fill opacity=1] (0,0) circle (0.8cm);          \fill [white,circular glow={fill=white}] (0,0) circle (0.8cm); % the glowing effect     \fill [white,path fading=fade out] (0,0) circle (1.6cm); %the fading effect          \end{tikzpicture}     \end{document}      **MWE Output**   ![enter image description here](http://i.stack.imgur.com/E5YPh.png)


title: Side reaction arrows: in and out

text: I want side arrows coming in and out of the reaction, a ubiquitous convention in biochemistry yet astonishingly not supported by packages like mhchem. mychemistry supports it (see p26 of package manual in the link for examples). Alas mychemistry.sty is not available to me on QuickLatex because of its recency. How can I do this without the aid of mychemistry and without extreme hacking and modifying source code? I'm not a programmer, and I know nothing about Tex. I also don't know how to use picture packages like Tikz. So unless it involves a simple invocation of pre-defined commands, I prefer to avoid it.


title: Macro with \n doesn't work, not sure why.

text: I created a macro called `\code` to wrap all the code fragments in my book,               \newcommand{\code}[1]{\emph{#1}}      But for some reason when I use this `\code{\\\n}`, I never get the `\n` displayed. For some reason it turns it into a real new-line and text gets wrapped at that point. Here is a screenshot that illustrates it. Any ideas what is going on? ![enter image description here](http://i.stack.imgur.com/QOVSu.png) And here is LaTeX code that creates this:               \begin{lstlisting}     awk '{ print $0 "\n" }'     \end{lstlisting}          This one-liner appends the newline symbol \code{\\n} to the     whole line \code{\$0} and prints it.


title: multicol and figures

text: I have a two column document (using `multicol`) and want to insert figures so that they do NOT span columns. I have searched around and the only thing I can find says that only `figure*` is supported which spans the whole page (both columns). Is there a way to get single column figures in a document using `multicol`s?


title: Place floats on a separate page before the referring text

text: I am familiar with how/why LaTeX places floats in the way it does. I have searched for questions here and have read many answers relating to "floats", "left/right pages", etc., but have not found a solution. I use the `book` class, but with the `oneside` option. I can change this to another class if it will not affect my document. I would like to place selected floats on their own page before the text which refers to them, so that the page with the float can become a left/facing page to the text, which is the "right" page. The entire document is one-sided and will be printed one-sided. I realize that this will mean that the float/s will appear before the text referring to them -- that is exactly what I would like. More than one float may be placed on the page if necessary. For example:               +----1---+     |  Some  |     |  Text  |     |        |     +--------+          +----2---+     | Float1 |     |        |     | Float2 |     +--------+          +----3---+     | See    |     | Fig 1. |     | Text   |     +--------+      I have not considered the `semioneside` package, as it contains many warnings and recommendations not to use it in its documentation.


title: Define dependencies when using tikz externalize

text: At the beginning of my document I have `\input{tikzcommands}` where `tikzcommands.tex` contains global settings that I want to use in the TikZ pictures. For example, in this file I define some styles. The problem, when using the `externalize` library it doesn't recognizes when something changed with the `tikzcommands.tex`. I tried to add something like `\tikzpicturedependsonfile{tikzcommands.tex}` at the beginning of the TikZ environment, but it didn't help. What is the right way to make `figureA.tex` (which is included using `input`) depended on a settings file `tikzcommands.tex`? _**EDIT:**_ Due to the comment of @Psirus I _know_ that I'm doing something wrong. But I still don't manage to have the desired behavior, even when trying to use `mode=list and make`. Here is my original pseudo MWE. First, I load `TikZ`               \usepackage{tikz}     \usetikzlibrary{snakes,calc,decorations.pathreplacing,patterns}      Then, I have the following               \makeatletter     \IfFileExists{tikzexternal.sty}     {%       \usetikzlibrary{external}%       \tikzexternalize%       \tikzsetexternalprefix{figures/cache/}%       \renewcommand{\todo}[2][]{%         \tikzexternaldisable\@todo[##1]{##2}\tikzexternalenable}%     }%     {%       % Empty else case     }%     \makeatother      Which checks is `externalize` is available, or not. This part I have to make the code compatible with older distributions of `pgf` which do not support the `externalize` package. Then I have an included file `tikzcommands.tex` which contains (among other things)               \tikzset{             robot/.style={thick,fill=green!#1},             obstacle/.style={fill=red!80,thick}     }      Finally in the document's body I have `input`s of the following form:               \input{./figures/figureA}       In `figureA` I use the styles `robot` and `obstacle`. I want to use externalize in such a way that even when I just change the file `tikzcommands.tex` the figures which depend on it will be re-compiled. I understand that I have to:   1. Change the loading of the `externalize` package.   2. Add something before each `input` which depends on the `tikzcommands.tex`   3. Probably change the building workflow. Currently I'm using `latexmk` alone. I tried several combinations but nothing worked for me. I hope someone could draw the way to accomplish this.


title: Section title gradient

text: ## Background Writing a manual using KOMA Script. The default fonts are perfect and should not be changed. ## Problem KOMA Script produces the following section outline: ![enter image description here](http://i.stack.imgur.com/Ytt8W.png) The desired outline looks similar to the following (gradient extended to left and right margins): ![enter image description here](http://i.stack.imgur.com/0NvdX.png) The troubles I have encountered:   * The fount for numerals and text changes.   * Retaining the text spacing.   * Expanding or extending the gradient box to:      * the left and right margins (`\textwidth`?); and     * a bit larger than the section (or subsection) text's top and bottom margins. ## Source Code My first attempt resembles:               \let\oldsection\section     \renewcommand{\section}[1]{%       \oldsection[#1]{         \setlength\fboxrule{0pt}%         \setlength\fboxsep{0pt}%         \tikz[background rectangle/.style={left color=blue!20,right color=white},         show background rectangle]          \node [inner sep=0pt] (0,0) {#1};%       }     }      This produces: ![enter image description here](http://i.stack.imgur.com/jCFE5.png) ## Update Changing the text width for the node helps:               \node [text width=\textwidth, inner sep=0pt] (0,0) {#1};%      This produces: ![enter image description here](http://i.stack.imgur.com/cKzbi.png) ## Related   * How to set the font for a \section title (and chapter etc)   * Framing section headings ## Question How would you implement a margin-to-margin gradient (preferably using TikZ) that is slightly larger than the text?


title: Subfiles errors while using style in the main file

text: I would like to build a modular document in latex. My main directory (in which I put the main file "thesis.tex") is called "tesi". Inside "tesi" i have another directory named "capitoli" where I woluld like to store my chapters named "chapter1.tex","chapter2.tex", and so on. Also I woluld like to compile either from my main file or directly from my subfiles, and so I used the subfile package. Also I'm using a style file named mystyle.sty placed in the main directory "tesi". There is also a directory called "immagini" (where i store my images) inside the main directory. If I use the following code               % main file "thesis.tex" in the main directory "tesi" %     \documentclass[a4paper,12pt]{memoir}     \usepackage{./tesi/mystyle.sty}     \begin{document}     \subfile{../tesi/capitoli/chapter1.tex}     \end{document}          % subfile "chapter1.tex" in the subdirectory "capitoli" %     \documentclass[../thesis.tex]{subfiles}     \begin{document}       \begin{figure}       \centering       \includegraphics{../immagini/image1.jpg}       \end{figure}     \end{document}      I can compile from subfile "chapter1.tex" but can't compile from main file "thesis.tex" (error messages refers to the path of the image files) If I use the following code ( just changed the relative/absolute paths of mystyle.sty and image1.jpg)               % main file "thesis.tex" in the main directory "tesi" %     \documentclass[a4paper,12pt]{memoir}     \usepackage{../tesi/mystyle.sty}     \begin{document}     \subfile{../tesi/capitoli/chapter1.tex}     \end{document}          % subfile "chapter1.tex" in the subdirectory "capitoli" %     \documentclass[../thesis.tex]{subfiles}     \begin{document}       \begin{figure}       \centering       \includegraphics{./immagini/image1.jpg}       \end{figure}     \end{document}      I can't compile from subfile "chapter1.tex" (error message cannot find mystyle.sty) but can compile from main file "thesis.tex". Someone could fix this issue, thanks. ## Edit I also post mystyle.sty                  \usepackage[T1]{fontenc}             \usepackage[utf8]{inputenc}         \usepackage[italian]{babel}         \usepackage{subfiles}        \usepackage{graphicx}


title: How to properly place an object based on axis?

text: I would like to place a rectangle in one of my graphs. However it seams that I am mixing dimensions. Is there a way to make sure that `\draw` uses the same dimension and would fill what is currently enclosed by "estimates"?               \documentclass[tikz]{standalone}          \usepackage{pgfplots}     \usepackage{verbatim}          \begin{document}     \centering          \begin{tikzpicture}     \begin{axis}[                 width=0.8\textwidth,                 height=0.4\textwidth,         ]         \addplot {-x};             \addlegendentry{model}         \addplot coordinates {             (1,1)             (1,2)             (2,2)             (2,1)             (1,1)         };             \addlegendentry{estimate}     \end{axis}                \draw[fill=blue] (1,1) rectangle (2,2);     \end{tikzpicture}          \end{document}


title: Horizontal lines in resume class?

text: I have a document as follows:               \begin{resume}          \section{Education}          % text here          \hrulefill          \section{Research Experience}          % text here          \hrulefill          \end{resume}      Essentially, I want to add a horizontal line between each section, but given that each section title is in a column on the left, and the content of that section is in a larger column to the right, the horizontal line just spans the second column when I want it to go along the first column of section titles too. Any ideas how to do this?


title: How to add unavailable document class for LyX on Linux?

text: I need the `IEEEtran` document class, and LyX asked for `IEEEtran.cls`. I have found it googling, now how do I install it? I've found a similar questions but that's for LyX on Mac; but I'm on Ubuntu (not Mac) so I don't know if that question will help me.


title: Divide the page into 2 parts

text: I have text, formulas and an enumeration. I tried to use `multicols`, but it divides the text where it wants. I used `tabular`, but it don't allow to have an enumeration or I don't know how to do it. In other words, I want to divide some piece of the page into 2 parts as it is shown in the picture: ![enter image description here](http://i.stack.imgur.com/1oQnB.png) I also want to save an enumeration. See also the border and alignment of the second part of the page. How can I do it in LaTeX?


title: How can I have the three source-code symbols _ < > produce themselves (_ < >) in the typeset output by default?

text: I use LaTeX to take quick notes about my programming work. I have a couple of frustrations:   * I need to use underscore a lot because of variables named with underscores. However, I have to escape each one of them "`\\_`", thus making my notes less readable on the markup side.   * I commonly want to use "`<`" and "`>`" symbols - why oh why are the default representations of these symbols "`¿`" and "`¡`"? Is there anyway I can alter LaTeX so that "_", "<", and ">" literally typeset as "_", "<", and ">"?


title: Section headers in Century Gothic, text in Garamond

text: I'm trying to comply with the following graphical profile in a LaTeX2e document. Ideally, I'd like to specify all these things in a package, which I can then import to instantly comply with the specifications. > Header 0 (document title): Century Gothic Bold, 20 pt, caps   >  Header 1: Century Gothic Bold, 16 pt   >  Header 2: Century Gothic, 14 pt   >  Header 3: Century Gothic Italic, 12 pt   >  Text: Garamond, 10 pt   >  Captions: Garamond Italic, 12 pt I've been looking around to find a way to use the Century Gothic font in LaTeX, but found nothing useful. The only examples I've found require XeTeX, which I don't know and would like to avoid having to learn just for this. How do I implement these specifications using LaTeX2e? _(Importing more packages is of course completely OK, as long as they are publicly_ available.)


title: How do I install the SIGCHI template with MacTex?

text: Just to note, I am new to latex. I followed the instructions for installing new latex, bib, and bst files from SIGCHI on the MacTex FAQs page. When I open the sample.tex and attempt to compile it using TexWorks using PDFLatex, it renders, but does not create the references. It gives me an error saying they cannot be found.


title: lost linear_shade output

text: What is wrong with my code? The second call of SoundEnergy lost the black/white gradient.               \startMPinclusions          def SoundEnergy =           path pr ; pr := unitsquare xscaled .3cm yscaled 2cm ;     currentpicture:=nullpicture;     for i=0 step 2 until 10:        linear_shade(pr shifted (i*.3cm,0),0,white,black);        linear_shade(pr shifted ((i+1)*.3cm,0),0,black,white);           endfor;       clip currentpicture to (0,0)--(0,2cm)--(2cm,2cm)--(3cm,1cm)--(2cm,0)--cycle;          draw (0,0)--(0,2cm)--(2cm,2cm)--(3cm,1cm)--(2cm,0)--cycle withcolor .625red;           addto finalpicture also currentpicture shifted(avanco*3.5cm,0) ;         currentpicture := nullpicture ; avanco := avanco+1 ;           enddef;     \stopMPinclusions               \starttext                    \startMPcode          picture finalpicture ; finalpicture := nullpicture ;     numeric avanco ; avanco := 0 ; bboxmargin := 0pt ;          SoundEnergy;SoundEnergy;     currentpicture := finalpicture ;          \stopMPcode               \stoptext      ![enter image description here](http://i.stack.imgur.com/lp1KD.jpg)


title: Error report in this equation

text: I get the > "Missing `}` inserted `\end{multline}`" when I run the equation below, please someone help me please.               \begin{multline}     {G_1} = \frac{{{2^{m - 1}}(m - 1)!}}{{{{\left( {\frac{m}{{\overline \gamma}}} \right)}^m}}}\frac{{\overline \gamma  }}{{m + \overline \gamma}}{e^{ - \frac{\lambda }{2}\frac{m}{{m + \overline \gamma  }}}}\left[ {\left( {1 + \frac{m}{{\overline \gamma  }}} \right){{\left( {\frac{m}{{m + \overline \gamma}}} \right)}^{m - 1}}\\ \times {L_{m - 1}}\left( { - \frac{\lambda }{2}\frac{{\overline \gamma  }}{{m + \overline \gamma  }}} \right) + {{\sum\limits_{n = 0}^{m - 2} {\left( {\frac{m}{{m + \overline \gamma  }}} \right)} }^n}{L_n}\left( { - \frac{\lambda }{2}\frac{{\overline \gamma  }}{{m + \overline \gamma  }}} \right)} \right]     \end{multline}here


title: Combining a userdefined float inside a shadowbox

text: Is it possible to combine the "program" part in a shadowbox?               \documentclass{article}          \usepackage{float}          \floatstyle{ruled}     \newfloat{program}{thp}{lop}     \floatname{program}{Program}          \begin{document}          \begin{program} ## FROM HERE       \begin{lstlinsting}[basicstyle={\footnotesize},language=Java,showstringspaces=false,tabsize=4]          class HelloWorldApp {       public static void main(String[] args) {         //Display the string         System.out.println("Hello World!");       }     }     \end{lstlisting}       \caption{The Hello World! program in Java.}     \end{program} ## TO HERE          \end{document}      Example is slightly modified from the one at the bottom of link text. Here is an image of what I want to put in the shadowbox. The image is borrowed from the above page. ![alt text](http://i.stack.imgur.com/D4kGd.png)


title: Adding a background image with tikz poster

text: When using the `tikzposter` package, is it possible to add a background image? I currently have a colour gradient, and would preferably like to keep this intact, and superpose the image on top of that. The current document looks somewhat like this:               \documentclass{tikzposter}     \tikzposterlatexaffectionproofoff          %% colors     % title     \definecolor{backgroundcolortop}{RGB}{255,255,255}     \definecolor{backgroundcolormiddle}{RGB}{255,255,255}     \definecolor{backgroundcolorbottom}{RGB}{91,195,240}          \title{Ttile}     \author{{\LARGE Authors}\\{\normalsize email}}     \institute{{\Large Institute}}          \begin{document}     \titleblock[seperated=false, embedded=true]     %...     \end{document}


title: pdflatex renders document with all dashes in bold

text: I have proceeded a new installation of LaTeX (in a new system: Ubuntu 12.04), I was installing from tug.org. Previously I was using TeX Live installed by apititude, on Ubuntu 10.04. I'm using Kile as editor, xdvi for dvi, Okular for pdf files. In all my LaTeX files I was using encoding utf-8x (`\usepackage[utf8x]{inputenc}`). In the new installation I was getting error message from `inputenc`: _utf-8x definition not found_. I've found that utf-8x is outdated, so I've changed to utf-8 and it worked. When I run command `latex (view with xdvi)` the dashes are normal. When I run `pdflatex`, the dashes are in bold and whole text doesn't look nice. Here is the screenshot of a part of the document: ![screenshot](http://i.stack.imgur.com/4uqvQ.png) UPDATE               </home/mariajulia/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecbx2488.600pk>         </home/mariajulia/.texmf-var/fonts/pk/ljfour/jknappen/ec/ectt1000.600pk> </home/mariajulia/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecrm0800.600pk> </home/mariajulia/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecrm0600.600pk> </home/mariajulia/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecrm0700.600pk> </home/mariajulia/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecbx1000.600pk> </home/mariajulia/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecti1000.600pk> </home/mariajulia/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecrm1000.600pk> </home/mariajulia/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecbx1440.600pk></usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsy10.pfb>      UPDATE I've removed whole installation and proceded a new one, this time without unchecking anything. The log file contains two               Installing [1518/2569, time/total: 02:08:52/03:24:08]: minted [360k] TLDownload::get_file: response error:    400 FTP return code 000 permanent server connection set up, but downloading did not succeed!Retrying with wget.     Installing [1519/2569, time/total: 02:09:59/03:25:50]: minutes [273k]      Second time was after `active-conf [327k]` package, the next one is `actuarialangle [3k]`


title: Define a macro expanding into quotes

text: I need a macro that expands an `argument` into the string `{ "argument"}`. The following macro seems to do the trick:               \newcommand{\myquote}[1]{\{ "{#1}"\}}      This macro produces for the input `xyzzy{\myquote{fubar}}` the output `xyzzy{ ”fubar”}` which is what I expect. However, the macro seizes to work properly once I add the package `ngerman` to my document by writing in the header `\usepackage{ngerman}`. Now the input `xyzzy{\myquote{fubar}}` no longer produces the expected output, but instead results in an error when running `latex`:               ! ngerman: The command "fubar is undefined.      I have tried to modify the macro with               \newcommand{\myquote}[1]{\{ \noexpand"{#1}\noexpand"\}}      This gets rid of the error, but the quotes `"` are not displayed at all anymore. The observed output becomes `xyzzy{ fubar}` instead of the expected one (the quotes are simply missing). How do I need to write the macro that produces the expected output even in the presence of the `ngerman` package? **[Edit] Clarification:** The macro is needed as a marker for a post- processor. Thus, there must not be typographical quotes, but regular double quotes. **[/Edit]**


title: How create circle node in Tikz with T from lines inside? T made split node to 3 sectors

text: I woud like create 3 sector circle node. See the following figure ![enter image description here](http://i.stack.imgur.com/cDDcW.png) sectors are bounded by lines