latex , Align tables in LaTeX [closed]


Align tables in LaTeX [closed]

Question:

Tag: latex

Is there a way to align tables in LaTeX?

I was writing a document with several tables in the same page, and often the edges don't match.

I would like to have tables aligned in both left and right edge.

\paragraph{Articoli}
\begin{large}
\begin{tabular}{ | l | l | l | p{3cm} |}
\hline
\textbf{Attributo} & \textbf{Tipo} & \textbf{Byte} & \textbf{Complessivo} 
\\    \hline
& & & 1500 occorrenze \\ \hline
Codice & Char(7) & 7 & 10,7 kB \\ \hline
Nome  &  Varchar (100) & 100 & 150 kB  \\ \hline
Marca & Varchar (100) & 100 & 150 kB \\ \hline
Prezzo & Money & 8 & 12,2 kB \\ \hline
Disponibile & Integer & 4 & 6.2 kB \\ \hline
Soglia & Integer & 4 & 6.2 kB \\ \hline
Reparto & Char (4) & 4 & 6.2 kB \\ \hline
Totale &  & &   321 kB      \\ \hline
Dati + Block Header & & & 322 kB \\ \hline
    \end{tabular}
\paragraph{Reparti}
 \begin{tabular}{ | l | l | l | p{3cm} |}
    \hline
    \textbf{Attributo} & \textbf{Tipo} & \textbf{Byte} & \textbf{Complessivo}        
     \\ \hline
    & & & 120 occorrenze \\ \hline
    Codice & Char(4) & 4 & 0,5 kB  \\ \hline
    Nome  &  Varchar (100) &  100 & 12.1 kB \\ \hline
    Sezione & Char(4) & 4 & 0.5 kB \\ \hline
    Totale &  & &  12.2 kB        \\ \hline
    Dati + Block Header & & & 12.3 kB \\ \hline
        \end{tabular}
  \paragraph{Pagamenti}
 \begin{tabular}{ | l | l | l | p{3cm} |}
    \hline
    \textbf{Attributo} & \textbf{Tipo} & \textbf{Byte} & \textbf{Complessivo} \\ \hline
    & & & 10 occorrenze  \\ \hline
    Codice & Char(4) & 4 & 0,1 kB \\ \hline
    Nome  &  Varchar (100) &  100 & 1 kB  \\ \hline
            Totale &  & &  1.1 kB       \\ \hline
            Dati + Block Header & & & 1.2 kB  \\ \hline
        \end{tabular}

Answer:

There are a number of ways to achieve this alignment:

  1. Use a single tabular that would contain everything. This ensures the columns all use the same width:

    enter image description here

    \documentclass{article}
    
    \begin{document}
    
    \begin{tabular}{ l | l | l | l | p{3cm} |}
      \cline{2-5}
      & \textbf{Attributo} & \textbf{Tipo} & \textbf{Byte} & \textbf{Complessivo} \\
      \cline{2-5}
      & & & & 1500 occorrenze \\ \cline{2-5}
      & Codice & Char(7) & 7 & 10,7 kB \\ \cline{2-5}
      & Nome  &  Varchar (100) & 100 & 150 kB  \\ \cline{2-5}
      & Marca & Varchar (100) & 100 & 150 kB \\ \cline{2-5}
      \textbf{Articoli} & Prezzo & Money & 8 & 12,2 kB \\ \cline{2-5}
      & Disponibile & Integer & 4 & 6.2 kB \\ \cline{2-5}
      & Soglia & Integer & 4 & 6.2 kB \\ \cline{2-5}
      & Reparto & Char (4) & 4 & 6.2 kB \\ \cline{2-5}
      & Totale &  & &   321 kB      \\ \cline{2-5}
      & Dati + Block Header & & & 322 kB \\ \cline{2-5}
      \multicolumn{1}{l}{}\\[\bigskipamount]
      \cline{2-5}
      & \textbf{Attributo} & \textbf{Tipo} & \textbf{Byte} & \textbf{Complessivo} \\
      \cline{2-5}
      & & & & 120 occorrenze \\ \cline{2-5}
      & Codice & Char(4) & 4 & 0,5 kB  \\ \cline{2-5}
      \textbf{Reparti} & Nome  &  Varchar (100) &  100 & 12.1 kB \\ \cline{2-5}
      & Sezione & Char(4) & 4 & 0.5 kB \\ \cline{2-5}
      & Totale &  & &  12.2 kB        \\ \cline{2-5}
      & Dati + Block Header & & & 12.3 kB \\ \cline{2-5}
      \multicolumn{1}{l}{}\\[\bigskipamount]
      \cline{2-5}
      & \textbf{Attributo} & \textbf{Tipo} & \textbf{Byte} & \textbf{Complessivo} \\
      \cline{2-5}
      & & & & 10 occorrenze  \\ \cline{2-5}
      & Codice & Char(4) & 4 & 0,1 kB \\ \cline{2-5}
      \raisebox{.5\normalbaselineskip}[0pt][0pt]{\textbf{Pagamenti}} &
        Nome  &  Varchar (100) &  100 & 1 kB  \\ \cline{2-5}
      & Totale &  & &  1.1 kB       \\ \cline{2-5}
      & Dati + Block Header & & & 1.2 kB  \\ \cline{2-5}
    \end{tabular}
    
    \end{document}
    

    Drawbacks here are the tables don't break across the page boundary (unless you use something like longtable or ltxtable).

  2. Use boxes/overlapping/phantoms to adjust the appropriate entries so they align:

    enter image description here

    \documentclass{article}
    
    \begin{document}
    
    \leavevmode\rlap{\textbf{Articoli}}%
    \phantom{\textbf{Pagamenti}}
    \begin{tabular}{ | l | l | l | p{3cm} |}
      \hline
      \textbf{Attributo} & \textbf{Tipo} & \textbf{Byte} & \textbf{Complessivo} \\
      \hline
      & & & 1500 occorrenze \\ \hline
      Codice & Char(7) & 7 & 10,7 kB \\ \hline
      Nome  &  Varchar (100) & 100 & 150 kB  \\ \hline
      Marca & Varchar (100) & 100 & 150 kB \\ \hline
      Prezzo & Money & 8 & 12,2 kB \\ \hline
      Disponibile & Integer & 4 & 6.2 kB \\ \hline
      Soglia & Integer & 4 & 6.2 kB \\ \hline
      Reparto & Char (4) & 4 & 6.2 kB \\ \hline
      Totale &  & &   321 kB      \\ \hline
      Dati + Block Header & & & 322 kB \\ \hline
    \end{tabular}
    
    \bigskip
    
    \leavevmode\rlap{\textbf{Reparti}}%
    \phantom{\textbf{Pagamenti}}
    \begin{tabular}{ | l | l | l | p{3cm} |}
      \hline
      \textbf{Attributo} & \textbf{Tipo} & \textbf{Byte} & \textbf{Complessivo} \\
      \hline
      & & & 120 occorrenze \\ \hline
      Codice & Char(4) & 4 & 0,5 kB  \\ \hline
      Nome  &  Varchar (100) &  100 & 12.1 kB \\ \hline
      Sezione & Char(4) & 4 & 0.5 kB \\ \hline
      Totale &  & &  12.2 kB        \\ \hline
      Dati + Block Header & & & 12.3 kB \\ \hline
    \end{tabular}
    
    \bigskip
    
    \textbf{Pagamenti}
    \begin{tabular}{ | l | l | l | p{3cm} |}
      \hline
      \textbf{Attributo} & \textbf{Tipo} & \textbf{Byte} & \textbf{Complessivo} \\
      \hline
      & & & 10 occorrenze  \\ \hline
      Codice & Char(4) & 4 & 0,1 kB \\ \hline
      Nome  &  Varchar (100) &  100 & 1 kB  \\ \hline
      Totale &  & &  1.1 kB       \\ \hline
      Dati + Block Header & & & 1.2 kB  \\ \hline
    \end{tabular}
    
    \end{document}
    

    Note the use of % at the end of the overlapping line; this is to avoid a spurious space. See What is the use of percent signs (%) at the end of lines?

Here is another presentation using booktabs and siunitx, foregoing the excessive use of horizontal rules and no vertical rules at all:

enter image description here

\documentclass{article}
\usepackage{booktabs,siunitx,etoolbox}
\newcommand{\tipochar}[1]{Char~(#1)}
\newcommand{\tipovarchar}[1]{Varchar~(#1)}
\newcommand{\tipomoney}{Money}
\newcommand{\tipointeger}{Integer}

\sisetup{%
  round-integer-to-decimal, 
  round-precision = 1,
  round-mode = places
}%
\robustify\bfseries
\begin{document}

\begin{tabular}{ 
    >{\hspace*{1em}\itshape}l
    l
    S[table-format = 3.1]
    S[table-format = 3.2]}
  \toprule
  \multicolumn{1}{l}{\bfseries Attributo} & 
    \bfseries Tipo & 
    \multicolumn{1}{l}{\bfseries Byte} & 
    \multicolumn{1}{l}{\bfseries Complessivo [kB]} \\
  \midrule
  \multicolumn{1}{l}{Articoli} &            &     & \multicolumn{1}{c}{\num{1500} occorrenze} \\
    Codice              & \tipochar{7}      &   7 &  10.7 \\
    Nome                & \tipovarchar{100} & 100 & 150   \\
    Marca               & \tipovarchar{100} & 100 & 150   \\
    Prezzo              & \tipomoney        &   8 &  12.2 \\
    Disponibile         & \tipointeger      &   4 &   6.2 \\
    Soglia              & \tipointeger      &   4 &   6.2 \\
    Reparto             & \tipochar{4}      &   4 &   6.2 \\
    Totale              &                   &     & 321   \\
    Dati + Block Header &                   &     & 322   \\[.5\normalbaselineskip]
  \multicolumn{1}{l}{Reparti} &             &     & \multicolumn{1}{c}{\num{120} occorrenze} \\ 
    Codice              & \tipochar{4}      &   4 &   0.5 \\
    Nome                & \tipovarchar{100} & 100 &  12.1 \\
    Sezione             & \tipochar{4}      &   4 &   0.5 \\
    Totale              &                   &     &  12.2 \\
    Dati + Block Header &                   &     &  12.3 \\[.5\normalbaselineskip]
  \multicolumn{1}{l}{Pagamenti} &           &     & \multicolumn{1}{c}{\num{10} occorrenze} \\
    Codice              & \tipochar{4}      &   4 &   0.1 \\
    Nome                & \tipovarchar{100} & 100 &   1   \\
    Totale              &                   &     &   1.1 \\
    Dati + Block Header &                   &     &   1.2 \\
  \bottomrule
\end{tabular}

\end{document}

Related:


statsmodels summary to latex


python,latex,statsmodels
I'm a newbie to latex and I want to import a statsmodels(python-package) summary to my report in latex. I found that it's possible to transform a summary into a latex tabular with the following method: latex_as_tabular. Until now everything is working. Now I have to store the tabular, but I...

Add sections to beamer presentation using rmarkdown and knitr


r,latex,markdown,knitr,rmarkdown
I am trying to add section slides to a beamer presentation written in rmarkdown using the latex command \section{}. However, it gets inserted between a \begin{frame} & \end{frame} automatically during the conversion, which causes the compilation to fail. Is there any way to stop this happening so that the section...

kable() in knit pdf appears oversized


r,table,pdf,latex,knitr
I am using the kable() function to output a table in a Rmd knit pdf document. I am however experiencing an issue with it. When I knit pdf, the table that it's outputting is oversized by width and ends-up being cropped. Please see below a mock code to run in...

Convert Mathematica equations into R code


r,latex,wolfram-mathematica,mathml
Is there an easy way to convert Mathematica equations into R code? I have several equations that consist of dozens of terms with subscripts, superscripts, and greek letters. For example, here's a small part of one equation in Latex format: m_2_2= 48 b_1 c_2^2 d_1 \rho ^4+48 b_2 c_1^2 d_2...

adding author emails and affiliation on 2nd second line not as a footnote [closed]


latex
Latex code that i have executed, insert emails as a footnote which i want to insert under the author name or on the same line with affiliation. i have insert an image of the required format as well. \documentclass[a4,12pt,twosided,reqno]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{authblk} \title{More than one Author with different Affiliations} \author[1]{Sadique...

I want to use figures as [item] in latex


latex,tex
In latex, I can use itemize and \item as follows. \begin{itemize} \item ... \end{itemize} I also can write as follows. \begin{itemize} \item[(any strings)] ... \end{itemize} However I can't write as follows. \begin{itemize} \item[\includegraphics{imagename}] ... \end{itemize} I want to use figures as \item of itemize in latex. Any ideas?...

Converting Tex string in Tex number


string,numbers,latex,tex
I have problem using automatically generated Tex string in arguments where a numeric value are required (e.g. in ifthenelse comparison). Here is a sample minimal code : \newcommand\testC{123} \ifthenelse{\testC<0}{negative}{positive} % works fine ! \newcommand{\testD}{\luaexec{tex.write("123")}} % write to avoid the print carriage return - produces also 123 as \testC \testD %...

Subscript and superscript alignment using only HTML markup


html,latex,html4
The following picture can be easily produced using a latex rendering software: In particular superscript and subscript parts are one over the other. Is it possibile getting the same result using only HTML 4 syntax by some clever use of <sup> and <sub> tags, without use of CSS or MathML?...

latex equation display in vim


vim,latex
I recently use the vim to write the latex source. But I got a very strange problem. When I open a old .tex file with vim, the equation will not show as usual. For example, when I type $K$, it just display K unless I move cursor to the line...

Incorrect conversion from R Markdown to LaTeX


latex,knitr,rmarkdown,pandoc
Why does the following R Markdown minimal (non)-working example not compile to PDF? --- header-includes: - \usepackage{fancyhdr} - \pagestyle{fancy} - \lhead{} - \chead{} - \rhead{The performance of new graduates} - \lfoot{From: K. Grant} - \cfoot{To: Dean A. Smith} output: pdf_document: keep_tex: yes latex_engine: xelatex --- # Test In particular, the...

Error in applying a for loop to an xtable in knitr


r,latex,knitr,xtable
I'm preparing a pdf using knitr that contains a table produced using xtable. I'm adding a bold typeface to certain cells in the table so I've written the following function: bold <- function(x, matrix){ x[] <- lapply(x, as.character) for (i in 1:ncol(x)) { yes <- matrix[,i] x[yes,i] <- paste('\\textbf{', x[yes,i],...

PDF page number clashes with LaTeX page number when included


r,pdf,latex
Another day, another question! I have created a documentation of an R package using R CMD Rd2pdf workdir/. The documentation is done in roxygen2 comments. I now wanted to include this pdf into my LaTeX script, which I have managed as follows: \usepackage{pdfpages} \includepdf[pages=-,pagecommand={\thispagestyle{plain}}]{docu.pdf} which means that I included all...

Error: missing \begin{document} in LaTeX [closed]


latex
I have error in my LaTeX document, when run my file, have a error ! LaTeX Error: Missing \begin{document}. and this tag \begin{document} exists in my code \documentclass[12pt‎, ‎a4paper]{article}‎ \usepackage{graphicx} % inserting images \usepackage[top=3cm,right=3cm,bottom=2.5cm,left=2.5cm]{geometry} \usepackage[colorlinks,linkcolor=blue,citecolor=red]{hyperref} \usepackage{multirow} \usepackage{subfig} \usepackage{algorithm} \usepackage{algorithmic} %\usepackage[utf8]{inputenc} %\usepackage{color, pdfcolmk} %\usepackage{sweave} %...

pyreport LaTeX formulae not working


python,ubuntu,latex,pyreport
I'm trying to create a HTML report using pyreport and it works up to the single point, that the LaTeX formulae are not generated. Here is the input file I use for testing: #$ This is \LaTeX : $c = 2\cdot(a+b)$ Than I run pyreport -l -t html --verbose file.py,...

texvc does not render latex math in Mediawiki


latex,mediawiki,mediawiki-extensions
I have the Math extension installed in my MediaWiki 1.19. After I updated Ubuntu Server from 12.04 to 14.04 something seems to have messed it up and it has stopped working. Basically I get the following error when I try to display anything between the <math> and </math> tags: Failed...

Matlab - How to generate LaTeX out of a transfer function?


matlab,latex
I have a transfer function as: TF = 0.00995 z^7 - 0.02786 z^6 + 0.03611 z^5 - 0.0293 z^4 + 0.01565 z^3 - 0.005669 z^2 + 0.001274 z - 0.0001554 ---------------------------------------------------------------------------------------------------------- z^8 - 2.4 z^7 + 3.16 z^6 - 2.664 z^5 + 1.585 z^4 - 0.666 z^3 + 0.1975 z^2...

What does this required empty parameter mean, when defining something?


latex
\newenvironment{nameOfEnvironment}[1][]% Can someone explain the empty bracket?...

(datatool in LaTeX)DTLforeach: Can't assign XXX there is no keys in XXX?


latex
i am a beginner for LaTeX, and currently trying to create tables from text files(just for some reason the data was generated from an other program and written in a .txt file) And here is one of the text file:(just integrated it into latex) \begin{filecontents*}{d11.csv} Zeit/s AMES\_13 AMES\_14 AMES\_15 AMES\_16...

Is it possible to include an input box within a LaTeX equation with MathJax?


html,latex,mathjax
I have the document: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Distribution</title> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]} }); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <script src="distrib.js"></script> <link href="distrib.css" rel="STYLESHEET">...

Latex Indentation


latex,indentation
I have a list which I want to indent from the section title. I have tried \indent and \hspace{1cm} without success. Here is my code \vspace{0.2in} \section{Affiliations} \vspace{0.1in} \indent The American Geophysical Union.\\ \hspace{1cm} The Seismological Society of America. ...

XeLaTex + FontAwesome


fonts,latex,font-awesome
I am trying to use FontAwesome in XeLaTex on OS X. So I followed the steps described on this github: Save this into your project folder as fontawesome.sty Put \usepackage{fontawesome} into the preamble Define command for FontAwesome: \newfontfamily{\FA}{FontAwesome Regular} Redefine required characters (optional): \def\twitter{{\FA \faTwitter}} Use: \href{http://twitter.com/swaycz}{\twitter\ swaycz} So that...

Latex \newcommand in kramdown


github,latex,jekyll,kramdown
I understand that cramdown does not support \newcommand type macros. Is there a workaround that does not involve Pandoc, so that it could be used with Jekyll in a GitHub blog? This would be the input markdown: --- layout: post --- \newcommand{\a}{\alpha} This is a test $$\a$$. The output should...

Arrange lua/lualatex data in a Latex/tex tabular


lua,latex,tex,tabular
I have data in lua, accessible to a LaTeX/TeX document (it is an array). I try to show this data in a LaTeX tabular form. I tried several ways to do this but all failed :( . Here is an example : \begin{tabular}{|c|c|c|}\hline A&B&C\\ \hline 2010 & 2,78 &\\ \hline...

I can't find the format file `pdflatex.fmt'!


php,latex,fedora,pdflatex,php-5.2
I want to run pdflatex from php on user request. Running from terminal works fine [php file.php] and creates pdf file. But when I try to run from browser by sending request to php, It gives this error "I can't find the format file `pdflatex.fmt'!" I am working with php5.2.6,...

How can I use values and charts in a knitr / LaTeX document before R has calculated them?


r,latex,knitr
A knitr document contains sections of R and LaTeX. My boss wants to read the summary (in LaTeX), but doesn't want to read the R. However the R should be available in an appendix, so the code can be checked if needs be (see below). How to I make values...

os.path.getsize Invalid syntax error


python,latex
First thing first, code is list below, import sys import os import latexmake import mysql.connector conn = mysql.connector.connect(user='root',password='oilwell',host='localhost',database='sqlpush1') with conn: mycursor = conn.cursor() mycursor=execute("SELECT DATE,oil,gas,oilprice,gasprice,totrev FROM results WHERE DATE BETWEEN '2011-01-01' AND '2027-12-01'") rows = mycursor.fetchall() a.write("\\documentclass{standalone}\\usepackage{booktabs}\n\n\\usepackage{siunitx}\r \n\ \r\n\\begin{document}\r\n\\begin{tabular}{ccS[table-format...

How can I output this table with indexes in latex?


latex
How can I outputthis table exactly like that in LaTeX? I'm using the latest versions of WindEdt and LaTeX. Thank you....

“Something's wrong, perhaps a missing \item” error when using itemize


list,latex
I'm trying to make list using itemize, and I honestly can't see whats wrong with this. I'm sure I'm just missing something small. \documentclass{article} \author{} \title{Essay research} \begin{document} \maketitle{} \section{Alternative fuel sources} Thorium based nuclear power stations offer advantages over classic uranium based ones: \begin{itemize}: \item Thorium-232 is much more...

Building Latex/Tex arguments in lua


lua,latex,tex
I use lua to make some complex job to prepare arguments for macros in Tex/LaTex. Part I Here is a stupid minimal example : \newcommand{\test}{\luaexec{tex.print("11,12")}}% aim to create 11,12 \def\compare#1,#2.{\ifthenelse{#1<#2}{less}{more}} \string\compare11,12. : \compare11,12.\\ %answer is less \string\test : \test\\ % answer is 11,12 \string\compare : \compare\test. % generate an error...

Vertical align text to a box next to it


latex,pandoc
In the output below, I'm trying to align Author with the top of the box next to it. I've tried a couple of different boxes and whatnot, but I can't get it to align properly. Here's the code: \mbox{ Author } \fbox{\begin{minipage}[c]{12cm} \medskip $for(author)$ $author.name$\\$if(author.title)$\emph{$author.title$}\\$endif$$if(author.company)$$author.company$$endif$ \par\medskip $endfor$ \medskip \end{minipage}} ...

How to install the IOP (Institute of Physics) Latex document class for Texlive and the Lyx Document Processor (Answer Provided)


latex,document,physics,lyx,latex-environment
Background I originally asked a question on Stackoverflow, asking how I add the IOP document class to the list of available document classes in Lyx. (I will try to remove or merge that out dated quesiton.) I now understand that this is a 2-stage process. Stage 1 is to install...

Knitr preamble error results in “pandoc document conversion failed with error 43”


r,latex,knitr,rmarkdown,tex
Rstudio Version 0.99.441; Windows 7 enterprise; knitr 1.10.5; MiKTex 0.4.5 r.1280 (2.9 64-bit) I have a an error on my office computer when trying to knit PDF's in Rstudio, there are no problems knitting to HTML or word. The problem may be related to updates because knitting used to work...

split an equation with multicols on


compiler-errors,latex,equation,multicol
I would like to split my large equation in two column. But my file fails to compile when I try to use \{amsmath} and then split, multline, etc... The error says: Package amsmath Error: \begin{multline} allowed only in paragraph mode. \begin{multline} Does someone knows how to split a large equation...

Making LaTex Lists Wrap


formatting,latex
So I have the following LaTex list, and many like it in a paper I'm translating: \begin{enumerate} \item If $\mathfrak{E}$ and $\mathfrak{B}$ with the arguments $x, y, z$ a solution of the Maxwell's equations (1), then through the components $\mathfrak{E}_x, \mathfrak{E}_y, \mathfrak{-E}_z, \mathfrak{-B}_x, \mathfrak{-B}_y, \mathfrak{B}_z$, with the arguments $x, y,...

Problems cross referencing in LaTex with knitr and xtable


r,latex,knitr,xtable,cross-reference
I am currently working with R Studio to produce PDF documents with R/knitr in LaTex. Within these documents I want to present part of my results in tables that I want to refer to in the text. I produce these tables using the xtable package within R and it is...

how to use cleveref package to get Fig. in latex


latex
When I use the cleveref package in latex, if I use \cref{fig1}, I got fig. 1 and if I use \Cref{fig1} I got Figure 1. But what I really want is Fig. 1. How can I do that?

using source(“X.R”) in Sweave file


r,latex,sweave
I need to use a function in my Sweave file to execute chunk codes. For example, I have function MEAN <- function(x) mean(x) in my directory, then I want use the chunk code x=c(1,2,3,4) MEAN(x) in my Sweave file. Does anyone know how can I do that? Thanks....

improper matrix print out latex


matrix,printing,latex
using Latex to print out a Matrix , I noticed I can not place the numbers under each other correctly here is the code, I really appreciate your help \begin{center} $ABD= \begin{bmatrix} 12610207.7\quad 5695754.3\quad 0\quad 0\quad 0\quad 0 \\ 5695754.3\quad 10737818.8\quad 0\quad 0\quad 0\quad 0 \\ 0\quad 0\quad 2800468.2\quad 0\quad...

LaTeX Equations Not Rendered on Webpage


r,latex,markdown,knitr
When I go to a webpage, such as this page of examples, none of the LaTeX code is being rendered in any of the browsers I try. However, on the same computer, if I create a simple R Markdown file in RStudio and I click Knit HTML, the preview in...

How to search and replace from the last match of a until b?


regex,vim,latex
I have a latex file in which I want to get rid of the last \\ before a \end{quoting}. The section of the file I'm working on looks similar to this: \myverse{some text \\ some more text \\}% % \myverse{again some text \\ this is my last line \\}% \footnote{possibly...

math in axes labels for gnuplot (epslatex terminal) not formatted correctly


latex,gnuplot
Using the following script in gnuplot (v 5.0) to generate a graph set terminal epslatex unset key set xlabel "$\zeta$" set ylabel "$\rho$" set output "strange_graph.tex" plot sin(x) set terminal wxt set o along with a latex document to include it, \documentclass{article} \usepackage{amssymb} \usepackage{graphicx} \begin{document} \begin{figure} \begin{center} \include{strange_graph} \end{center} \end{figure}...

ValueError in matplotlib when using \: LaTeX horizontal spacing


python,matplotlib,latex
See MWE below: import matplotlib.pyplot as plt import matplotlib.offsetbox as offsetbox fig = plt.figure() ax = fig.add_subplot(111) text1 = r'$a\,=\,{}\pm{}$'.format(0.01, 0.002) # Works. text2 = r'$a\;=\,{}\pm{}$'.format(0.01, 0.002) # Works. text3 = r'$a\:=\,{}\pm{}$'.format(0.01, 0.002) # Does not work. text = text3 ob = offsetbox.AnchoredText(text, pad=1, loc=6, prop=dict(size=13)) ob.patch.set(alpha=0.85) ax.add_artist(ob) plt.show() While...

Generating LaTeX tables instead of text in Rstudio


r,latex,rstudio
I am new to latex, and would like to generate PDF tables instead of text so my example is: in my METHOD.tex file I have this text: In the first group there were: AAA: items: BBB: items2 and: CCC: items3. We assessed: EEE: implementations. Of the total: VVV: objects to...

Latex how to quote command


latex
Could you please help me, how to quote command in Latex? for example In my work I describe what "\usepackage{tikz}" does,but it compile me as command and show as an error, not as part of my text.

How to count Tabular


latex,pdflatex
for some reason i need to make many tables with latex, and non of them should have caption nor labels, but they need to be numbered like Subsection.tableNo. I have tried to use \begin{tabular}{ccc} ...& ... & No.: \arabic{subsection}.\arabic{table}\\\hline ..... \end{tabular} however, because i'm using only tabular environment, the table...

Automatically scaling numbers in a table using stargazer


r,latex,stargazer
I wish to create a number of tables with numerical elements of very different scales. For example, tables with the variance of various variables down the diagonal, and the correlations off the diagonal. The larger numbers make the tables too big, and are harder to read. Is there a good...

Extract average model from MuMIn for latex output


r,latex,stargazer,texreg
I'm trying to extract two different averaged models from MuMIn for output to latex via texreg or stargazer. I'd like to have one table where I can compare two species' response to different sets of abiotic variables, that looks the same as one created from two model objects using glmtable...

How to Parse LaTex file


python,regex,parsing,python-3.x,latex
I just finished to write the summary for calculus in Latex. The main problem now is that the files contains many things I don't really need now. The .tex files contains many definitions and theorems that i need to study by heart. The definitions have their own definition in the...

Change LaTeX when button is pressed


javascript,html,latex
I am trying to create a program that generates random functions then shows them in LaTeX but I can't figure out how to edit LaTeX when a button is pressed. This code works: <html> <head> <script type="text/javascript" src="http://latex.codecogs.com/latexit.js"></script> </head> <body> <div lang="latex" id='Latexdiv'></div> <script> document.getElementById('Latexdiv').innerHTML = 'sin(x)'; </script> </body> </html>...

Mathjax: how to deal with this strange behavior?


web,latex,mathjax
I am using the markdown editor and I have loaded Mathjax in all pages of my website like this: <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$$","$$"],["$","$"],["\\(","\\)"]] } }); </script> <script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> I have realized that this line of latex works well: $(u_1)$ However, this one does not work (basically latex...