The standard header of the latex file exported from org is:
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
etc.
My .org file contains text in Hebrew. To make that work with latex, I need to modify the header as follows:
\documentclass[11pt]{article}
% BEGIN for Hebrew support
\makeatletter
\let\l#hebrew\l#nohyphenation
\makeatother
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[english, hebrew]{babel}
% END for Hebrew support
% DISABLED \usepackage[utf8]{inputenc}
% DISABLED \usepackage[T1]{fontenc}
\usepackage{fixltx2e}
etc.
I tried beginning my org file like this:
#+LATEX_HEADER: \makeatletter
#+LATEX_HEADER: \let\l#hebrew\l#nohyphenation
#+LATEX_HEADER: \makeatother
#+LATEX_HEADER: \usepackage{ucs}
#+LATEX_HEADER: \usepackage[utf8x]{inputenc}
#+LATEX_HEADER: \usepackage[english,hebrew]{babel}
However, this inserts the lines much later in the header than needed. Also, it does not take care of removing the lines that need to be removed to avoid conflicts.
Is it possible to do what I need?
Related
There is a lot of space in the beginning which I do no like. And also to other sections (but only the start page of the section). Do you guys have any clue on how to reduce the vertical space between the header and the actual content.
\documentclass[12pt, a4paper, oneside, openany]{scrbook}
\pagestyle{headings}
%page layout
\setlength{\voffset}{0mm}
\setlength{\topmargin}{0mm}
\setlength{\headsep}{0mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\evensidemargin}{0mm}
\setlength{\textheight}{210mm}
\setlength{\textwidth}{150mm}
\setlength{\marginparwidth}{5mm}
\setlength{\marginparsep}{3mm}
\setlength{\marginparpush}{7mm}
\setlength{\parindent}{5mm}
\setlength{\footskip}{0mm}
\usepackage{fontspec}
\fontspec{Times New Roman}
\usepackage{url}
\linespread{1.5}
\usepackage[acronym]{glossaries}
\parindent 10mm
\parskip 5mm
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage[a4paper]{geometry}
You can redeclare the sectioning command which you'd like to change and set whatever beforeskip you like:
% !TeX TS-program = lualatex
\documentclass[12pt, a4paper, oneside, openany]{scrbook}
\pagestyle{headings}
\RedeclareSectionCommand[beforeskip=0pt]{chapter}
%page layout
\setlength{\voffset}{0mm}
\setlength{\topmargin}{0mm}
\setlength{\headsep}{0mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\evensidemargin}{0mm}
\setlength{\textheight}{210mm}
\setlength{\textwidth}{150mm}
\setlength{\marginparwidth}{5mm}
\setlength{\marginparsep}{3mm}
\setlength{\marginparpush}{7mm}
\setlength{\parindent}{5mm}
\setlength{\footskip}{0mm}
\usepackage{fontspec}
\fontspec{Times New Roman}
\usepackage{url}
\linespread{1.5}
\usepackage[acronym]{glossaries}
\parindent 10mm
\parskip 5mm
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage[a4paper]{geometry}
\begin{document}
\chapter{title}
\end{document}
Answer courtesy of https://tex.stackexchange.com/questions/62125/how-to-remove-top-margin-above-tableofcontents. Visit this excellent post to get a comprehensive explanation and alternative methods to do your stuff.
Add the following to your preamble:
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\let\oldtableofcontents\tableofcontents
\renewcommand{\tableofcontents}{\begingroup%
\patchcmd{\#makeschapterhead}% <cmd>
{\vspace*{50\p#}}% <search>
{}% <replace>
{}{}% <success><failure>
\oldtableofcontents%
\endgroup%
}
\makeatother
The above does a local search-and-replace within #makeschapterhead (replacing \vspace*{50\p#} with nothing, before calling the regular table of contents. The redefinition (search-and-replace) is localized within the scope of the group.
I am new to overleaf. I am getting first 'No control sequence' on \subfloat. Then I included \usepackage{subfig} which is causing this new error 'no counter subfigure#save defined' on the same line. Along with that after including this package I am also getting 'Undefined control sequence' on \begin{document}. Any idea how can I tackle this? I want to insert multiple figures and I read that \subfigures is outdated and I should include subfloat instead. I would really really appreciate any possible help. Thank you
screenshoot of error
These are the packages that are included :
\documentclass[a4paper, 12pt, oneside]{Thesis} % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn
\usepackage{subfig}
\usepackage{graphicx}
%\usepackage[dvipsnames]{xcolor}
\graphicspath{ {images/} }
\usepackage{amsmath}
% Include any extra LaTeX packages required
\usepackage[square, numbers, comma, sort&compress]{natbib} % Use the "Natbib" style for the references in the Bibliography
\usepackage{verbatim} % Needed for the "comment" environment to make LaTeX comments
\usepackage{vector} % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths
\hypersetup{urlcolor=red, colorlinks=false} % Colours hyperlinks in blue, but this can be distracting if there are many links.
\usepackage{longtable}
\usepackage[table]{xcolor}
\usepackage[textsize=tiny]{todonotes}
\newcommand{\dara}{\textsf{da\textbar ra}}
\usepackage{csquotes}
\usepackage{ctable}
\usepackage{titlesec}
\usepackage[most]{tcolorbox}
\usepackage{tikz-er2}
\usepackage{url}
\usepackage{paralist}
\usepackage{pifont}
\usepackage{adjustbox}
\usepackage[T1]{fontenc}
\usepackage[scaled=0.85]{beramono}
\usepackage{listings}
\usepackage{tikz}
\usepackage{3dplot}
\usepackage{framed}
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{todonotes}
\usepackage{comment}
\usepackage{pifont}
\usepackage{amssymb}
\setcounter{tocdepth}{3}
\usepackage{multirow}
\usepackage{algorithm}% http://ctan.org/pkg/algorithms
\usepackage{algorithmic}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepackage{eurosym} %<-- For EURO symbol
\usepackage{filecontents}
\usepackage{minted}
\usemintedstyle{monokai}
\usepackage{array}
% \usepackage{forest}
\usepackage[table]{xcolor}
[EDIT]
I am having issues changing the citation style to my document. I am currently working with this preamble. There are a lot of packages, but I need them to organise the entire file. The current code works ok, but the citation style is not correct. I need to change it to apa 6th edition.
Preamble:
\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{helvet}
\usepackage{xspace}
\usepackage{subcaption}
\usepackage{placeins}
\usepackage{wrapfig}
\usepackage{multirow}
\usepackage[table,xcdraw]{xcolor}
\usepackage{adjustbox}
\usepackage{booktabs,caption}
\usepackage[flushleft]{threeparttable}
\usepackage{ragged2e}
\usepackage{floatrow}
\usepackage{graphicx,wrapfig,lipsum}
\graphicspath{{../figs/}}
\usepackage{pdfcomment}
\usepackage{geometry}
\newgeometry{left=2.5cm,right=2.5cm,bottom=2.5cm}
\usepackage[english]{babel}
\usepackage{CJKutf8}
\pagestyle{headings}
\usepackage{blindtext}
\usepackage{csquotes}
\setcounter{secnumdepth}{4}
\usepackage{titlesec}
\usepackage[T1]{fontenc}
\usepackage{imakeidx}
\makeindex[columns=3, title=Alphabetical Index]
\usepackage{array}
\usepackage{tikzpagenodes}
\usepackage[format=plain, labelfont={bf,it}, textfont=it]{caption}
\usepackage{fancyhdr}
\usepackage[toc,nopostdot, nonumberlist,style=long,automake,acronym]{glossaries}
\usepackage{subfiles}
\usepackage{nicematrix}
\usepackage{amsmath,mathabx}
\usepackage{hyperref}
\usepackage{lscape}
\newcommand{\sectionbreak}{\phantomsection}
\hypersetup{
colorlinks=true,
linkcolor=black,
filecolor=black,
urlcolor=black,
citecolor=olive,
pdftitle={PhD Dissertation},
pdfpagemode=FullScreen,
}
\urlstyle{same}
%\bibliographystyle{abbrvnat}
%\usepackage[authoryear]{natbib}%/bibliography apa
%\setcitestyle{authoryear,open={(},close={)}} %Citation-related commands
The bibliography file called bib.bib
Example:
#article{henriquez_alternative_2017,
title = {An alternative objective microscopic method for the identification of linear enamel hypoplasia ({LEH}) in the absence of visible perikymata},
volume = {14},
doi = {10.1016/j.jasrep.2017.05.040},
journal = {Journal of Archaeological Science: Reports},
author = {Henriquez, Alejandra Cares and Oxenham, Marc F.},
year = {2017},
pages = {76--84},
file = {Full Text:C\:\\Users\\xello\\Zotero\\storage\\MV7QMSWQ\\Henriquez and Oxenham - 2017 - An alternative objective microscopic method for th.pdf:application/pdf},
}
Example of text citing something
\begin{document}
\begin{CJK*}{UTF8}{min}
\citep{henriquez_alternative_2017}, \citet{henriquez_alternative_2017}.
\end{CJK*}
\end{document}
I need to change the citation style to apa6: https://www.ctan.org/pkg/apa6. When Io tried to add this package. It entered into conflict with other packages like titlesec and amsmath, mathabx.
I get errors like
...ex/titlesec/titlesec.sty, 1642. Argument of \subparagraph has an
extra }. or Runaway argument?
or
eric/mathabx/mathabx.sty, 67. Latex Error: Too many symbol fonts
declared.
respectively.
I am not sure how to add this citation style to my current project. Maybe there is an alternative way? I need the packages I am using (like titlesec) to order my document.
Any help will be welcomed.
Thank you,
[EDIT] Solved it. I used Biblatex (https://ctan.org/pkg/biblatex-apa6?lang=en) which also has an apa6 option. Solved additional errors. Works well.
I had recently posted a question seeking help for linking a glossary in a specific way and it was resolved, thanks to #samcarter_is_at_topanswers.xyz for helping me out. url to the post
Now, going ahead with the suggestions, I make use of \hyperref package in my project and that is causing an issue with the use of \footnotemark[]. I have attached the screenshots below along with a MWE.
Screenshots :
With the hyperref package I get the error :
Without the hyperref package I get the output with no errors :
MWE :
\documentclass{article}
\usepackage[utf8]{inputenc} % Input encoding (this file): 8 bit unicode. Default by most text editors
\usepackage[T1]{fontenc} % Output encoding (pdf file)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Packages used in the example
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx} % Included graphics and some resizable boxes
\usepackage{url} % nice urls with line breaks
\usepackage{lipsum} % nonsense text blocks
\usepackage{float}
\usepackage{subcaption}
\usepackage{multicol}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{biblatex}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage[nonumberlist,acronym,
entrycounter=true
]{glossaries}
\makeglossaries
\newglossaryentry{vp}
{
name= Verification Plan,
description={A verification plan is a list of the procedures and methods to be used for verification}
}
\newacronym{ml}{ML}{Machine Learning}
%%UNCOMMENT THIS AND THERE IS AN ERROR WITH GLOSSARY
%\usepackage{hyperref}
%\hypersetup{
% citecolor=black,
% colorlinks=false, %set true if you want colored links
% linktoc=all, %set to all if you want both sections and subsections linked
% linkcolor=black, %choose some color if you want links to stand out
%}
\begin{document}
%\glsaddall
\setglossarystyle{altlist}
\printglossary
\printglossary[type=\acronymtype]
------
\textbf{Develop}: The develop phase includes \gls{vp}\footnotemark[\glsrefentry{vp}], creating verification environment, testbench and test case development. \acrfull{ml}
\end{document}
So in short, I want to have my glossary hyperlinked along with referencing it by using \footnotemark[\glsrefentry....].
Any solution/advice would be greatly appreciated! Thanks in advance!
With hyperref, the \glsrefentry{...} macro is a link to your list of acronyms, which conflicts with using it as a footnotemark. You can use e.g. \textsuperscript{...} as a workaround:
\documentclass{article}
\usepackage[utf8]{inputenc} % Input encoding (this file): 8 bit unicode. Default by most text editors
\usepackage[T1]{fontenc} % Output encoding (pdf file)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Packages used in the example
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx} % Included graphics and some resizable boxes
\usepackage{url} % nice urls with line breaks
\usepackage{lipsum} % nonsense text blocks
\usepackage{float}
\usepackage{subcaption}
\usepackage{multicol}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{biblatex}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage[nonumberlist,acronym,
entrycounter=true
]{glossaries}
\makeglossaries
\newglossaryentry{vp}
{
name= Verification Plan,
description={A verification plan is a list of the procedures and methods to be used for verification}
}
\newacronym{ml}{ML}{Machine Learning}
%UNCOMMENT THIS AND THERE IS AN ERROR WITH GLOSSARY
\usepackage{hyperref}
\hypersetup{
citecolor=black,
colorlinks=false, %set true if you want colored links
linktoc=all, %set to all if you want both sections and subsections linked
linkcolor=black, %choose some color if you want links to stand out
}
\begin{document}
\glsaddall
\setglossarystyle{altlist}
\printglossary
\printglossary[type=\acronymtype]
------
\textbf{Develop}: The develop phase includes \gls{vp}\textsuperscript{\glsrefentry{vp}}, creating verification environment, testbench and test case development. \acrfull{ml}
\end{document}
I am new on latex and lyx. I have to realize a resume and used moderncv. Do you know how I can have the space behing my picture being reduced ? (The one hatched in red) . As everything is supposed to fit in one page with a cv, it is important for me.
Thanks for your help
%% LyX 2.3.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{float}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{xmpmulti}
\usepackage{enumitem}
\moderncvtheme[grey]{classic}
\firstname{John}
\familyname{Do}
\title{Title}
\address{adress}{city}
\mobile{+33 6 §§ §§ §§ §§}
\email{john.do#ens.psl.eu}
\photo[100pt]{Mii_Artwork.png}
\makeatother
\usepackage{babel}
\begin{document}
\maketitle
\section{Formation}
\cventry{2021/2022}{Master de Science cognitive}{Ecole normale supérieure rue d'Ulm}{Paris}{France}{}
\end{document}
Quick hack: add \vspace{-1.5cm} after \maketitle :
`
%% LyX 2.3.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{float}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{xmpmulti}
\usepackage{enumitem}
\moderncvtheme[grey]{classic}
\firstname{John}
\familyname{Do}
\title{Title}
\address{adress}{city}
\mobile{+33 6 §§ §§ §§ §§}
\email{john.do#ens.psl.eu}
\photo[100pt]{example-image}
\makeatother
\usepackage{babel}
\begin{document}
\maketitle
\vspace{-1.5cm}
\section{Formation}
\cventry{2021/2022}{Master de Science cognitive}{Ecole normale supérieure rue d'Ulm}{Paris}{France}{}
\end{document}