Redefining latex macro using same name

Currently I use a \mytodo macro, which just calls \todo[inline]: \newcommand{\pbtodo}[1]{\todo[inline]{#1}} But I'd like to call this macro \todo. The simplest solution: \renewcommand{\todo}[1][]{\todo{#1}} unsurprisingly resulted in what I presume to be a stack overflow: ! TeX capacity exceeded, sorry [input stack size=5000]. Does anyone know a way to use the old \todo macro in a redefinition?

Figures occurring after ^ and _ macros (was: LaTeX limitation?)

I've hit an annoying problem in LaTeX. I've got a tex file of about 1000 lines. I've already got a few figures, but when I try to add another figure, It barfs with: ! Undefined control sequence. <argument> ... \sf@size \z@ \selectfont \@currbox l.937 \begin{figure}[t] If I move the figure to other parts of the file, I can get similar errors on different lines: ! Undefined control sequence. <argument> ... \sf@size \z@ \selectfont \@currbox l.657 \paragraph {A C

LaTeX changes colour of in-text citing with hyperref package and natbib

I am using the natbib and hyperref packages in my LaTeX document and would like to change the colour of the box around the hyper-referenced citations from the baseline green to a more muted colour (violet or navy blue). However, in using the suggested code to do this, I cannot get the citation link colours to change. MWE: \usepackage[usenames,dvipsnames]{color} \usepackage[round]{natbib} \usepackage[hyperfootnotes=false]{hyperref} \hypersetup{ colorlinks=false, citecolor=Violet, linkcolor=Re

LaTeX: How to change one of section numbers to a custom letter?

I have something like this: Section 1 ... Section 2 ... Section 3 Subsection 3.1 ... Section 4 ... And I would like to have something like this: Section 1 ... Section 2 ... Section A Subsection A.1 ... Section 4 ... In other words - change one of section numbers to something else 3 == A I need this for my thesis which is written in article class, and when I tried to add appendices the hyperref package broke, and "links" to section 1 directed to appendix A edit: I made a mistake when descr

LaTeX listings: different counters for different listing environments

How do I create two lstlisting environments that each have its own counter? If I use for example \lstnewenvironment{algorithm}[2]{ \renewcommand\lstlistingname{Algorithm} \lstset{ ... } } {} \lstnewenvironment{program}[2]{ \renewcommand\lstlistingname{Program} \lstset{ ... } } {} And then \begin{algorithm}{Algorithm caption}{alg-label} ... \end{algorithm} \begin{program}{Program caption}{prg-label} ... \end{program} Then they will share the counter, i.e. it will result

Latex: Problem with Multirow

I am creating a table with mulitrow but I am getting a problem. As far as I understand, this is the form of the multirow: \multirow{count}{alignment}{content} where count is the number of rows to merge, alignment is either l, c, r, or *, and content is the content of the row. I tried the following: \multirow{3}{*}{Framing} but I am getting a problem. Rather than seeing the word "Framing" in the cell, I see "3*Framing" which gives the indication that the \multirow element isn't working. Any

LaTeX bar chart

I am trying to make a bar chart using LaTeX. I've been unsuccessful so far, so can anyone help me out, perhaps with a copy of a recent project? How can I make a bar chart with pstricks? I would appreciate the most simple solution possible because I just got started with TeX recently. Like mentioned here in the official document This is what I have so far: \psset{unit=0.5in}% \begin{pspicture}(0,-0.5)(3,3)% \readpsbardata{\data}{example1.csv}% \psbarchart[barstyle={red,blue}]{\data}% \end{pspi

Latex Spacing issues with xspace

Let's say my macro is \newcommand{\k}{king\xspace}. Then the spacings in "... said the \k." will be fine. But what do I do if I want no spacing in the middle of \k\k.? I want "kingking." not "king king." Is there a way to do this?

Minimal LaTeX equation renderer on Windows (stripped MiKTeX?)

I'm successfully using MiKTeX to render LaTeX equation strings to PNG. However, the distribution of MiKTeX is really large (~360 MB for the uncompressed portable version), and I need only the equation rendering. Is there a stripped-down version of MiKTeX that eschews support for other features? Or is there stuff that I can remove safely and easily without breaking the equation rendering? (dictionaries, hyphenation stuff etc. comes to mind). I'd really like to use MiKTeX or equivalent, since the

Howto - Latex syntax with \section[]{}: Putting Brackets [ Inside of Brackets

I am writing a beamer presentation. My problem is a syntax issue with \section[Outline]{title}. \section is working fine with all of my section titles except in the following example: \section[$\mathbb{Z}[G]$-module constructions]{$\mathbb{Z}[G]$-modules and Geometric Constructions} I need a [ or \[ symbol around the G (i.e., [G]) in the Outline part of \section,however, Tex throws tons of errors whenever anything resembling a bracket is in there. All ideas are welcome and thanks in advanc

LaTeX: Cannot Create Document

I am just starting out with LaTeX, and trying to create my first document. I am using Mac OS X 10.8.3. After creating a hello.tex file, I then type latex hello into the command line. This returns the output below: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) restricted \write18 enabled. entering extended mode (./hello.tex LaTeX2e <2011/06/27> Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge rman-x-2012-05-30, ngerman-x-2012-05-30, a

Latex Running multiple commands in Sublime Text 2 build system

Does anyone know of a way of running multiple commands in ST2's build system, or if not, how can I make it run a bashscript (where I'll put the commands)? I'm attempting to use sublime text 2's build system to compile a latex document. At present I am manually running a bash script with multiple commands but it would be more convenient to be able to build directly from ST2. I have tried: { "osx": { "cmd": ["Compile"] } } but I get the error message: [Errno 2] No such file or directory

Latex How to change the title alignment just for the appendix sections?

I am formatting my dissertation document using a class usfdis.cls from However due to new specifications, the Appendices titles should now be Single-space and aligned to the left margin. The code referred to the appendix section in the usfdis.cls is the following: \renewcommand{\appendix}{% Appendices have a cover page and different % layout \clearpage \vspace*{0.6in} \addcontentsline{toc}{chapter}{\protect\numberline{Appendices}}

Summons in LaTeX

Is there any documentclass to write the summons in LaTeX? Documentclass Letter is inappropriate as it doesn't allow to write two columns on the begginig of the letter next to each other.

Latex Setting width or height for graphics in beamer only works with .png?

This is a problem I had with TexLive 2013 and 2014; working on Mac OS X, 10.8. I have to use xelatex or lualatex because of East Asian fonts. When using picture files with \includegraphics[settings-for-scaling]{filename}, I can only use .png files reasonably, JPEGs are always shown in their original size. I tried this with a minimum beamer document, graphicx package loaded. Also, I tried several ways to scale (cm, textwidth, etc.). Here are some examples: Replaced [settings-for-scaling]

Latex Split Big Matrix into Submatrices

I have a single big matrix which I want to split into small submatrices in order to fit the page width. The problem in this code is that the submatrices stay side by side and there is no paragraph break in the expected 'HERE' points. If they go side by side they don't fit the page width.

In LaTeX, how to escape to print out a block of text

The Problem: I just want to print a sequence like this in plain text: a (10) _/ \_ / \ (4) b c (4) _/ \___ / \ (8) d _ e _ (5) / \ / | \ f g h i j (2) (4) (1) (1) (6) I would like to avoid escaping all characters along the way, including special characters for preserving spaces. Essentially, I am drawing an ASCII pict

Latex how to split equation on two lines

I wrote the following two equations in latex, but the problem is when I run the code, both equation are written on the same line how can I split them on two lines \begin{equation} N = R * cos(lat) * sin(lon) \\ E = R * cos(lat) * cos(lon) \label{eq:gps_to_cartesian} \end{equation}

Latex Write theorem in MathJax?

Is there way to create something like the amsthm theorem-environment in MathJax? I believe that package is not supported. I added amsthm.js in default.html and nothing happens. <script type="text/x-mathjax-config"> MathJax.Hub.Config({ TeX: { extensions: ["amsthm.js", "AMSmath.js","AMSsymbols.js", "autobold.js"], } }); </script>

Latex pandoc.exe: Error producing PDF

I have tried running the following simple code; ```{r sample} library(knitr) library(kableExtra) dt <- mtcars[1:5, 1:4] # LaTeX Table knitr::kable(dt,format = 'latex')%>% column_spec(column = 1,width = '10cm',bold = T) ``` This runs fines with the Knit button. but get the following error when using rmarkdown::render(); ! Undefined control sequence. l.173 \centering\rowcolors pandoc.exe: Error producing PDF Error: pandoc document conversion failed with error 43 In addition: Warning

Latex IEEE submission issue

I create a Latex dvipdf in overleaf, where everything works fine and the pdf produced looks ok. All images are *.eps (IEEE requirement). When I upload all files to IEEE portal, the pdf produced has ONLY two pics misplaced like the following: Problem is I don't know where to look or what to change. The code used is very standard: \begin{figure}[!pt] \centering \subfloat[Initial graph setup] {\includegraphics[width\textwidth,keepaspectratio]{a1.eps} \label{fig:dodagBef}} \hfill \subfloat[Mobil

Latex How to read several files and write the content into a single file in Tex?

I have a task whose first step is to read several separate files and reorganize the content into a new single file in Tex. I tried with the following commands: \newwrite\myfile \immediate\openout\myfile=10solutions.tex \def\temp{\Input{inputFile}} \let\newtxt\temp \temp \newtxt \immediate\write\myfile{\newtxt} \immediate\closeout\myfile I can see the output of \temp and \newtxt is correct. However when I try to write into "myfile", it reports the following error: ! TeX capacity exceeded, so

Query related to wrapfig latex

i am using wrapfig command in latex to wrap text around figures, but it make really bad view, when i insert 3 images consecutively. Images inserted with 'r' option appears at left side of the page. Log states that 'floating environments overlaped' Can anybody help me in this regard.

Latex How to display beautiful math equations in p5.js?

Is there an easy way of rendering LaTeX equations in p5.js? I naively tried to use KaTeX by including their auto-render starting template in the index.html of a p5.js editor template and then writing an "equation" like text("$$\\epsilon = 0.4$$", 30, 30); in the draw() function. This failed, see here.

Latex Long chapter title in thesis

I am writing a thesis in latex, one of the chapters has quite a long title which I cannot rephrase or reduce. So, in the thesis, it extends the text width. How can I fix it, can the title be extended over multiple lines? \documentclass[a4paper,12pt, upper,crosshair,sfbold,chapterbib]{thesis} \usepackage{lipsum} \begin{document} \chapter{The title of the chapter: long long long long long long long long long long long long long long long} \lipsum \end{document}

An alternative to write multirow in latex's tabular?

In latex, I know we can use the multirow command like the following, \begin{table}[!h] \centering \begin{tabular}{|c|l|} \hline \multirow{2}{*}{A} & I want to place this sentence in multiple lines, \\ & but don't want to control the linebreak myself \\ \hline \end{tabular} \end{table} I think it is so stupid to control the linebreak myself. Any other alternative that fits the text width to line width?

Ibid. in LaTeX citations

How can I get LaTeX to automatically use "Ibid." when two citations to the same source are made? Here is a sentence with a citation.\footnote{\cite[p.~5]{Smith:1999}} This sentence also has a citation.\footnote{\cite[p.~10]{Smith:1999}} Desired: Here is a sentence with a citation.[1] This sentence also has a citation.[2] ... 1. Smith (1999), p. 5 2. Ibid., p. 10 Actual: Here is a sentence with a citation.[1] This sentence also has a citation.[2] ... 1. Smith (1999), p. 5 2. Smith (1999), p

Error using the fancyvrb LaTeX environment

Hi I'm trying to fancyvrb environment. I'm using a fully upgraded Ubuntu 9.04. If I issue a simple Verbatim environment, for example: \begin{Verbatim} foobar \end{Verbatim} it works. However, if I try to pass in a parameter, for example, setting the font size: \begin{Verbatim}[fontsize=8] foobar \end{Verbatim} This is ignored. If I try to set the color: \begin{Verbatim}[formatcom=\color{red}] foobar \end{Verbatim} I get the following error: Running `LaTeX' on `test' with ``la

Can I write cls files in LaTeX instead of TeX?

I have some initialization code in a XeLaTeX file which I would like to put into a separate file so that I can reuse it in future texts. What is the fastest way to convert my XeLaTeX code to a LaTeX class file?

Latex How to display my table "outside" an itemize structure so it will be centered in the page?

I have a document with an itemize structure and some table to display inside it. It have 3 subitem and the table is in the third one. Here is an example: \documentclass{article}% \usepackage{amsmath}% \usepackage{amsfonts}% \usepackage{amssymb}% \usepackage{graphicx} \begin{document} \begin{itemize} \item Item1 \begin{itemize} \item Subitem1 \begin{itemize} \item Subsubitem1 \begin{center} \begin{tabular}{ |l|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c| } \hline S & 1 &

What's the best way to understand the TeX / LaTeX internals?

Looking through docs on the TeX website, it seems like almost all documentation for TeX and LaTeX are tutorials on how to use them, how to install fonts, how to get graphics working, etc. What should I look at if I want to know more about how TeX works? For instance, I want to know about its parser grammar. I want to know how its text engine works, how it decides hyphenation, how it flows text, how it decides on box layouts. It seems like TeX and LaTeX are built up on several layers of diffe

Latex How do I render an Augmented Matrix with MathJax?

I'm looking for a way to render an Augmented Matrix in MathJax. In addition, I'd like to do things like right-align the text in the columns. I found a LaTeX solution for this, but I'm not sure how to integrate it with MathJax - or even if its possible. I notice that the \makeatletter command is not supported by MathJax. Is it possible to do this?

how do I type && in latex?

So i'm trying to make a table but it doesn't look to good since the lines break inside the table in a way I don't like. \begin{tabular}{|p{8cm}|p{1cm}|} \hline ! (4 < 5) & \\ ! false & \\ (2 > 2) ││ ((4 == 4) && (1 < 0)) & \\ (2 > 2) ││ (4 == 4) && (1 < 0) & \\ (34 != 33) && ! false & \\ \hline end{tabular} What happens is that it breaks into new lines after every "&&", how do I stop this from happening? How do I make

Latex apsrev4-1 error: ! File ended while scanning use of \@secondoftwo

I try to use apsrev4-1.bst as bibliographystyle to manage format of my prl (physical review letters) paper. However, I got a error I don't understand. Actually, my code works well if using prl.bst, but report error: "! File ended while scanning use of \@secondoftwo." (the reason I want to use apsrev4-1.bst instead of prl.bst is because prl.bst will show title in reference which I don't know why either). I haven't played with latex for very long time, and this is the first time I deal with bibtex

pandas dataframe as latex or html table nbconvert

Is it possible to get a nicely formatted table from a pandas dataframe in ipython notebook when using nbconvert to latex & PDF? The default seems to be just a left-aligned block of numbers in a shoddy looking font. I would like to have something more like the html display of dataframes in the notebook, or a latex table. Saving and displaying a .png image of an HTML rendered dataframe would also be fine, but how exactly to do that has proved elusive. Minimally, I would just like a simple

Latex Table all along the page

I am looking to have a similar style of the table in the picture. I just do not know the code would make it in this way. I know how to make table, but I do not know how would I make them in this way.

Latex Images not found in the same path

When I compile my .tex file, the following error is shown: LaTeX Warning: File `imagem2.png' not found on input line 767. ! Package pdftex.def Error: File `imagem2.png' not found. All files in the same paste of .tex file are not found. I've tried these commands, but don't work: \DeclareGraphicsExtensions{.JPG} \graphicspath{...} And I have these commands in my .tex file: \usepackage{graphicx}

Add numbers to bibliography - Latex

I have the problem with numbering references in my doc. Here's my preambule before \begin{document}: \documentclass[polish]{article} %\newcommand{\DoNotLoadEpstopdf}{} \usepackage[T1]{fontenc} \usepackage{polski} \usepackage[polish]{babel} \usepackage[margin=3cm]{geometry} \usepackage{graphicx} \usepackage[utf8]{inputenc} \usepackage[none]{hyphenat} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{titlesec} \usepackage{csquotes} \usepackage{indentfirst} \usepackage{datetime} \usepackage

Latex: In Springer class svjour3, want references sorted in alphabetical order, in author-year format

I am writing a paper in LAtex and using Springer macro package (svjour3 class). Requirement is: citations should be in the form of authoryear and sorted in alphabetical order. My tex file looks like: { \documentclass[smallextended]{svjour3} \usepackage{natbib} \begin{document} \title{abc} \bibliographystyle{spbasic} % basic style, author-year citations %\bibliographystyle{spmpsci} % mathematics and physical sciences %\bibliographystyle{apa} %bibliographystyle{spphys}

LATEX - how to display many transitions on one loop arrow?

I would like to display many transitions on one loop arrow in latex. The way I'm doing it right now, the 3 lines are displayed one on top of the other. How can I display the three lines on 3 different lines but on the same loop? \begin{tikzpicture}[->,shorten >=1pt,auto,node distance=4cm, semithick] \tikzstyle{every state}=[draw=black,text=black] \node[initial by arrow,state,initial text=] (1) {1}; \node[state] (2) [right of=1] {2}; \node[state] (3) [ri

Latex Highlight one specific author when generating references in Pandoc

I am using Pandoc to generate a list of publications for my website. I'm using it solely to generate the html with the publications so that I can then paste the raw html in jekyll. This part works fine. The complications arise when I tty to generate the html so that my name appears boldfaced in all entries. I'm trying to use this solution for that, which works when I apply it to a pure Latex document I am generating. However when I try to apply the same Pandoc, the html is generated without any

How to make a document with continuous text on odd pages only in latex?

Heey all, For my thesis, I'm dealing with a lot of figures with experimental data in one chapter. To maintain an overview for the reader, I would like to have text on the odd pages and figures on even pages. This way, when printing the document all text would be printed on the right side of the opened booklet and the figures on the left. Anyone an idea how to create this in latex?

Julia plotting issues: label overlap and LaTeXStings expansion

I am having two mutually exclusive issues with my sample plot below. The y-axis label and y-tick labels are on top of each other. I have not been able to find a way to shift either. I would like the size of the plot to expand to accommodate the necessary spacing. I want the y-axis label to be sigma with a subscript theta. It looks like Unicode does not allow a subscript theta. I was hoping to get around this limitation by using LaTeXStrings. However, I cannot get the LatexString to expand into

printing latex in jupyter

I'm working in Colab and it nicely prints latex code. I want it too, but I can't. I want to print multiple lines automatically and from string variable: sympy.symbols('foo_\\alpha') ​ print (sympy.symbols('foo_\\alpha')) foo_\alpha

Latex How to specify the font in an endnote?

The question is about formatting the endnote font in both 'report' and 'memoir' document classes when using the pagenote package. In the following minimal example the \footnotesize{} command is obeyed as expected when \footnote is used: the footnote is in 16pt as requested. When the endnote is used with \pagenote the endnotes appear as expected in both memoir and report environments, but in both cases the main text font is used. In effect, the question is how to create something like \endnotesi

Ending last chapter in latex before glossary/ index of acronymes

I have the problem of the glossary/ index of acronymes still being in the last chapter of my latex document. This causes the chapter number to appear in the header of these pages. How can I close the last chapter before calling \printglossary such that glossary and acronyme list are not part of a chapter. Relevant packages that I am using: \usepackage[nolist]{acronym} \usepackage[ngerman]{babel} \usepackage[toc, acronym]{glossaries} I already tried \clearpage \markboth{}{} right before calling

  1    2   3   4   5   6  ... 下一页 最后一页 共 16 页