Can't include a md file in a quarto book page - quarto

I'd like to include the readme.md file in the index of a quarto book (so I do not need to duplicate content).
According to these instructions in the official documentation, that should be possible.
This is my current structure:
/folders
...
_quarto.yml
index.qmd
README.md
...
This is my index.qmd file:
# Preface {.unnumbered}
This is a Quarto book.
{{< include README.md >}}
Regretfully, the readme file is not included. Instead, {{< include README.md >}} is printed as a text.
EDIT:
I have created this github project:https://github.com/ccamara/quarto-book-test . You can see the outputs here: https://ccamara.github.io/quarto-book-test/
This is what I've done so far:
Create a default project: quarto create-project mybook --type book
Create a README.mdfile in the project's root
Edit index.md (in the project's root) and added {{< include README.md >}}
Run quarto preview
I get a warning stating WARNING: Shortcode include is not recognized.
index.md does not render README.mdcontents, instead it displays the include shortcode as a regular text (see screnshot below).

I can't reproduce, unfortunately. I recreated your example, and got this:
This happens in quarto preview and quarto render both. What version and OS are you running? Can you run this and report the result? Thanks.
$ quarto --version

Related

Markdown and doxygen linking back to a file

Doxygen now allows to link md files to other md files with regular markdown syntax:
How do I link between markdown documents in doxygen?
I have the following file structure:
MyDir/README.md
MyDir/Docs/other.md
Linking from README.md to other.md is straigforward:
[My link](Docs/other.md)
However linking from other to Readme is not working:
[My back link](README.md)
Since doxygen generates its links relative to where it is run, and I am running doxygen on MyDir, that should be the correct relative path. I also tried
[My back link](../README.md)
Just in case, but no luck.

Dartdoc could not find any libraries to document

I am trying to document an api written in Dart with dartdoc.
The dart files i am trying to document are not in a "/lib" folder so when i launch dartdoc at the root of my api i get the following message:
Documented 0 libraries in 0.2 seconds.
dartdoc could not find any libraries to document. Run `pub get` and try
again.
Success! Docs generated into /home...
But the only documentation i get is the text written in the readME.md file.
My structure is something like this:
/apiRoot
pubspec.yaml
....
/web
/controllers
dartfiles_to_document.dart
.....
I read about official dartdoc documentation and searched there but found no solution to my problem.
I am looking for a way to generate documentation for those dart files.

Lyx: How to install the IOP document class [duplicate]

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 IOP styles and cls files etc for Texlive, and Stage 2 is to update Lyx to be able to use these.
I have now successfully done this on a Linux Mint distro. The method is described below. I will try to keep this updated if anything changes. Hopefully I have provided enough info for anyone to be able to do this regardless of distribution or OS. If not, add a comment so I can add required info.
Useful References:
The following items helped me complete this process:
Lyx Wiki Page for IOP: http://wiki.lyx.org/Layouts/Iopart
Section 5.1 of the Customization Manual (Help) Document provided in Lyx.
Open Lyx and Goto: Help -> Customization -> Section 5.1 of Document
The IOP Latex Document download page: ftp://ftp.iop.org/pub/journals/ioplatexguidelines.tar.gz
Stage 1 - Installing IOP Document Files for Texlive (Or Miktex)
Windows Users: Check this link for directory location info: http://wiki.lyx.org/Layouts/Iopart
The first step is to download the relevant files for IOP documents from here: ftp://ftp.iop.org/pub/journals/ioplatexguidelines.tar.gz
If this link has expired, then do a duckduckgo search for "iop latex guidelines". The IOP have a .tar.gz file with all required files for Latex publishing included.
The next step is to find the correct Texlive directory. For me this was: /usr/share/texlive/texmf-dist/tex/latex If you are using miktex this will be different.
Using root privileges, create a directory in this folder: sudo mkdir iopart
Again using root privilages, extract the .tar.gz archive you downloaded to the directory iopart. After doing this and running the command ls, you should see the following files:
iopams.sty iopart12.clo IOPGraphicsGuidelines.pdf IOPLaTeXGuidelines.tex iopart10.clo iopart.cls IOPLaTeXGuidelines.pdf setstack.sty
Not all of these are important. You may wish to read through the PDF files which contain info on how to write an IOP accepted publication. I believe the .tex file contains an example template which may help you.
Finally, reconfigure Texlive by running the command sudo texhash.
You should now have the IOP Document Latex files installed and be able to use them with texlive.
Stage 2 - Reconfigure Lyx
This step is trivial, open Lyx and goto: [Menu Bar] -> Tools -> Reconfigure
Stage 3 - Open a new Lyx Document and Test
Goto: File -> New from Template -> Select iop-article.lyx
Goto: Document -> Settings : Check that the document type is "iop article"
Click the "View" button in Lyx which compiles and opens your document.
You should see a example pdf file with some mock contents.

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

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 IOP styles and cls files etc for Texlive, and Stage 2 is to update Lyx to be able to use these.
I have now successfully done this on a Linux Mint distro. The method is described below. I will try to keep this updated if anything changes. Hopefully I have provided enough info for anyone to be able to do this regardless of distribution or OS. If not, add a comment so I can add required info.
Useful References:
The following items helped me complete this process:
Lyx Wiki Page for IOP: http://wiki.lyx.org/Layouts/Iopart
Section 5.1 of the Customization Manual (Help) Document provided in Lyx.
Open Lyx and Goto: Help -> Customization -> Section 5.1 of Document
The IOP Latex Document download page: ftp://ftp.iop.org/pub/journals/ioplatexguidelines.tar.gz
Stage 1 - Installing IOP Document Files for Texlive (Or Miktex)
Windows Users: Check this link for directory location info: http://wiki.lyx.org/Layouts/Iopart
The first step is to download the relevant files for IOP documents from here: ftp://ftp.iop.org/pub/journals/ioplatexguidelines.tar.gz
If this link has expired, then do a duckduckgo search for "iop latex guidelines". The IOP have a .tar.gz file with all required files for Latex publishing included.
The next step is to find the correct Texlive directory. For me this was: /usr/share/texlive/texmf-dist/tex/latex If you are using miktex this will be different.
Using root privileges, create a directory in this folder: sudo mkdir iopart
Again using root privilages, extract the .tar.gz archive you downloaded to the directory iopart. After doing this and running the command ls, you should see the following files:
iopams.sty iopart12.clo IOPGraphicsGuidelines.pdf IOPLaTeXGuidelines.tex iopart10.clo iopart.cls IOPLaTeXGuidelines.pdf setstack.sty
Not all of these are important. You may wish to read through the PDF files which contain info on how to write an IOP accepted publication. I believe the .tex file contains an example template which may help you.
Finally, reconfigure Texlive by running the command sudo texhash.
You should now have the IOP Document Latex files installed and be able to use them with texlive.
Stage 2 - Reconfigure Lyx
This step is trivial, open Lyx and goto: [Menu Bar] -> Tools -> Reconfigure
Stage 3 - Open a new Lyx Document and Test
Goto: File -> New from Template -> Select iop-article.lyx
Goto: Document -> Settings : Check that the document type is "iop article"
Click the "View" button in Lyx which compiles and opens your document.
You should see a example pdf file with some mock contents.

Include *.sty file from a super/subdirectory of main *.tex file

I want to share a latex document via git with many other people.
Therefore we decided to put all the special sty files, that are not present in everyones latex-installation, into a resources directory. It would be cool, if this dir would be a superdir. of the actual working directory
How exactly can I import those style files?
It is important that even the dependencies of those remote styles are resolved with other remote styles.
You can import a style file (mystyle.sty) into your document in two ways:
If you have it in your path or in the same folder as the .tex file, simply include this line in your preamble: \usepackage{mystyle}
If you have it in a different folder, you can access using its full path as \usepackage{/path/to/folder/mystyle}
That said, if you're not sure if the style file is in everyone's installation, simply include it in the same directory and make sure you do git add mystyle.sty and track it along with the rest of your files (although most likely there won't be any changes to it). There is no need for a parent directory. But if you insist on a different directory, see option 2 above.
It would be better if it were in a subdirectory than in a parent directory, as you can still call the file as \usepackage{subdir/mystyle} and be certain that you are invoking your style file. However, if you escape out to the parent directory, you never know if the other users have a similarly named folder that is not part of your package, which can result in errors.
This probably isn't relevant to you any more, but here is another way to do what you want.
Set up your git repository like this:
mystyle.sty
project/
makefile
project.tex
and put \usepackage{mystyle} in the preamble of project.tex.
Compiling project.tex manually won't work, of course, because mystyle.sty is not in the same directory as project.tex.
However, if makefile contains something along the lines of:
project.pdf: mystyle.sty project.tex
pdflatex project
mystyle.sty: ../mystyle.sty
cp ../$# $#
then running make from within the project directory will cause mystyle.sty to be copied to the correct place before project.tex is (this time successfully) compiled.
This way might seem a little bit over the top, but it does combine the best features of other methods.
If several projects in the same repository require mystyle.sty then having a common mystyle.sty sitting above them all makes more sense than having a copy in each project directory; all these copies would have to be maintained.
The compilation is portable, in the sense that if you gave me your copies of mystyle.sty and project.tex then I would (in theory at least) be able to compile manually without needing to modify the files you gave me.
For example, I would not have to replace \usepackage{/your/path/mystyle} with \usepackage{/my/path/mystyle}.
You can use Makefiles as suggested above. Another option is CMake. I didn't test for parent directories.
If you have the following file structure:
├── CMakeLists.txt
├── cmake
│   └── UseLATEX.cmake
├── img
│   └── logo.jpg
├── lib
│   └── framed.sty
└── main.tex
you should have CMake installed, instructions on CMake resources
UseLATEX.cmake can be downloaded from here
then inside the CMakeLists.txt
╚═$ cat CMakeLists.txt
cmake_minimum_required (VERSION 2.6)
set(PROJECT_NAME_STR myProject)
project(${PROJECT_NAME_STR})
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(UseLATEX)
ADD_LATEX_DOCUMENT(main.tex
IMAGE_DIRS img
DEFAULT_PDF
MANGLE_TARGET_NAMES)
Some example content for main.tex (note the image)
╚═$ cat main.tex
\documentclass{report}
\begin{document}
\begin{center}
\includegraphics[width=300px]{img/logo.jpg}
\end{center}
\end{document}
The lib directory has the *.sty files
You can now compile:
cd /directory/that/has/CMakeLists.txt/
mkdir build
cd build
cmake ..
make
you can then view main.pdf which is in the build directory.
When you use TeX distribution that uses kpathsea, you can use the TEXINPUTS environment variable to specify where TeX is looking for files. The variable needs to be used in the following way.
The paths in TEXINPUTS are separated by :. An empty path will include the default search paths, i.e., just the colon. Two consecutive slashes means that the directory and all sub-directories are searched.
Thus, e.g., to build a file document.pdf which uses files in the current directory, all sub-directories of the resources directory and the default directories, you can use the following Makefile.
document.pdf: document.tex
TEXINPUTS=.:./resources//: pdflatex document.tex
To speed up the filename lookup, you can build a ls-R database using the mktexlsr command.
For all the details on kpathsea take a look at the manual.
You can use latexmk and its facilities
There is a feature documented under Utility subroutines on page 48 here in latexmk which can update TEXINPUTS during a run. If you can consider to use the .latexmkrc file to configure your chain and options, you can add ensure_path() to the file:
Here is an example:
# .latexmkrc
ensure_path('TEXINPUTS', './path/to/something//', '/full/path/to/something/else//')
# [...] Other options goes here.
$pdf_update_method = 3;
$xelatex = 'xelatex -synctex=1 -interaction=nonstopmode -file-line-error %O %S';
$pdf_previewer = 'start "%ProgramFiles%/SumatraPDF/SumatraPDF.exe" %O %S';
$out_dir = 'build/';
Notice the // at the end of a path, This will aid LaTeX to search for files in the specified directory and in all subdirectories.
Please note that while this is an amazing feature, you need to take good care of your naming scheme. If you use the same file name several places, you can run into trouble when importing them with, say \include{somefile}.

Resources